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?
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
Displaying the picked items
hey,
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?
Thanks!
James
Hi, look at http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
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
Cheers,
/Dirk
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"/>
</a>
</xsl:for-each>
Great, thanks everyone - it was the Split function in umbraco.library that I was missing.
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:
is working on a reply...