Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • niccolo rossi 33 posts 53 karma points
    Nov 23, 2011 @ 16:25
    niccolo rossi
    0

    Combo Box with list of article inside the umbraco editor

    Hi all,

    inside the editor i need to put a combobox that contain a list of article's group so the user that write the page content can select the group of the article. 

    i try to explain better. 

    i've a "folder" that contain a list of group. 

    when the user create a new article, he can select the related group. 

    the combo have to display the group title and have the value of the group id.

    when the user save the new article i need to save also the group id and if the user select the article i ve to select the correct related group.

    is it possible? can u help me? a tutorial?

    thank you

    nico

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 23, 2011 @ 16:30
    Tom Fulton
    1

    Hi Nico,

    Check out the XPath DropDownList datatype from uComponents.  This allows you to have a DropDownList that populates from nodes elsewhere in your site.  You can give it an XPath expression to find your "Group" nodes, such as $ancestorOrSelf/ancestor-or-self::Home/ArticleGroups/ArticleGroup

    This can store the ID or Name of the selected node.

    Also if you want to have articles tied to multiple groups I would reccomend using MultiNode Tree Picker instead.

    Hope this helps,
    Tom

  • niccolo rossi 33 posts 53 karma points
    Nov 23, 2011 @ 17:11
    niccolo rossi
    0

    thank you!!! this is exactly what i need! :):) 

    just one last question:

    in the content page i have:

    Content

     - Pharmaretail

       - ArticleGroup

          - Group1

          - Group2

          -....

    what i've to write in the XPath Expression to obtain the Group1, Group2....?

    thank you

    nico


  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 23, 2011 @ 17:15
    Tom Fulton
    0

    Hi,

    It depends on where the Articles exist, since that's where the XPath will start.

    But something like this should work:

    $ancestorOrSelf/ancestor-or-self::Home/ArticleGroup/Group

    Replacing the following....

    Home - DocTypeAlias of your 'Pharmaretail' page

    ArticleGroup = DocTypeAlias of your 'ArticleGroup' page

    Group = DocTypeAlias of your 'Group1', 'Group2' pages.

    -Tom

  • niccolo rossi 33 posts 53 karma points
    Nov 23, 2011 @ 17:27
    niccolo rossi
    0

    WOW now all work fine! 

    really thanks

    nico

     

Please Sign in or register to post replies

Write your reply to:

Draft