Copied to clipboard

Flag this post as spam?

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

  • James Crowley 17 posts 38 karma points
    Sep 18, 2009 @ 01:19
    James Crowley

    Displaying the picked items


    I'm new to Umbraco so please forgive another beginner question. As far as I can see from the XML, this tree picker stores the selected nodes as a comma delimited list of IDs in the field? What's the best way to generate a list of links in one of the XSLT templates from this? I'm not sure how to split them out again so I can call the getNodeFromXPath function?



  • Petr Snobelt 923 posts 1535 karma points
    Sep 18, 2009 @ 08:52
  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 18, 2009 @ 08:53
    Dirk De Grave

    Hi James,

    Here's a post that may help you resolving this problem. Basically,you'll need to split the value of the property (of the tree picker) and iterate the values using GetXmlNodeById() available as xslt extension method




  • Jannik Nilsson 38 posts 81 karma points
    Sep 18, 2009 @ 08:55
    Jannik Nilsson

    If I understand you correctly, you'll do something like this:

            <xsl:variable name="items" select="umbraco.library:Split($siteRoot/data [@alias='footerLinks'], ',')" />
            <xsl:for-each select="$items/value">
                <xsl:variable name="itm" select="umbraco.library:GetXmlNodeById(.)" />
                <a href="umbraco.library:NiceUrl($itm/@id)">
                    <xsl:value-of select="$itm/@nodeName"/>

  • James Crowley 17 posts 38 karma points
    Sep 18, 2009 @ 11:50
    James Crowley

    Great, thanks everyone - it was the Split function in umbraco.library that I was missing.

  • Marco Lusini 176 posts 1370 karma points
    Sep 18, 2009 @ 11:57
    Marco Lusini

    Jannik answer works when the DataType is configured for UltimatePicker compatibility.

    As a reference you can use this code if the DataType is configured for Lefteris compatibiliy:

    <xsl:variable name="selection" select="$currentPage/data [@alias='pickedNodes']"/>
    <xsl:if test="count($selection/descendant::node) > 0">
      <xsl:for-each select="$selection/descendant::node">
       <xsl:variable name="itm" select="umbraco.library:GetXmlNodeById(.)" />
        <a href="{umbraco.library:NiceUrl($itm/@id)}">
         <xsl:value-of select="$itm/@nodeName"/>
Please Sign in or register to post replies

Write your reply to: