XSLT : How to read nested uComponent multinodepicker data
Hi All,
I have two nested uComponent Multi Node Picker Tree. I can read first level data and node details correctly, but as I traverse through second level nodes, XML data is not available. I can read the URL picker data correctly. Does anybody have solution to this?
Site Structure:
Home
-- Page1
-- Page2
-- Page3
-- Sections
----Section1
----Section2
----Section3
----Section4
home page contains the collection of sections, which are selected by tree picker.
<xsl:template match="/"> <!-- First we check that the Multi-node Tree Picker has any nodeId values --> <xsl:if test="$currentPage/sections/MultiNodePicker/nodeId"> <ul> <!-- Loop through each of the nodeId values --> <xsl:for-each select="$currentPage/sections/MultiNodePicker/nodeId"> <!-- Since we only have the nodeId value, we need to get the actual content node using umbraco.library's GetXmlNodeById method --> <!-- If you prefer to use pure XPath, then used this: "$currentPage/ancestor-or-self::*[@isDoc and @level = 1]/descendant-or-self::*[@isDoc and @id = current()]" --> <xsl:call-template name="RenderSection"> <xsl:with-param name="parent" select="."/> </xsl:call-template> </xsl:for-each> </ul> </xsl:if> </xsl:template>
<!-- First we check that the Multi-node Tree Picker has any nodeId values --> <xsl:if test="$node/sectionlinks/MultiNodePicker/nodeId"> <ul> <!-- Loop through each of the nodeId values --> <xsl:for-each select="$node/sectionlinks/MultiNodePicker/nodeId"> <xsl:variable name="childNode" select="umbraco.library:GetXmlNodeById(.)" /> <li> <a href="{umbraco.library:NiceUrl($childNode)}"> <xsl:value-of select="$childNode/@nodeName" /> </a> </li> </xsl:for-each> </ul> </xsl:if>
XSLT : How to read nested uComponent multinodepicker data
Hi All,
I have two nested uComponent Multi Node Picker Tree. I can read first level data and node details correctly, but as I traverse through second level nodes, XML data is not available. I can read the URL picker data correctly. Does anybody have solution to this?
Site Structure:
Home
-- Page1
-- Page2
-- Page3
-- Sections
----Section1
----Section2
----Section3
----Section4
home page contains the collection of sections, which are selected by tree picker.
Here is XML:
<section id="1121" parentid="1118" level="3" writerid="0" creatorid="0" nodetype="1120" template="0" sortorder="1" createdate="2012-07-12T15:35:50" updatedate="2012-07-13T17:11:43" nodename="Our Solutions" urlname="our-solutions" writername="admin" creatorname="admin" path="-1,1068,1118,1121" isdoc=""> <sectionlinks> <multinodepicker type="content"> <nodeid>1098</nodeid> <nodeid>1097</nodeid> <nodeid>1099</nodeid> <nodeid>1100</nodeid> </multinodepicker> </sectionlinks> <morelink> <url-picker mode="Content"> <new-window>False</new-window> <node-id>1087</node-id> <url>/solutions/</url> <link-title>More Services</link-title> </url-picker> </morelink> <title>Our Solutions</title> <bodytext> <p>Our Solutions details</p> </bodytext> <summary>Our Solutions summary</summary> <breadcrumbtitle>our-solutions</breadcrumbtitle> <umbraconavihide>0</umbraconavihide> <sitename> <sitedescription> <homenodeid></homenodeid> </sitedescription> </sitename> </section>Anybody???
Is it just me using a nested components?
Hi Sanjay,
The only thing I can spot here that seems to not do the right thing, is this one:
<a href="{umbraco.library:NiceUrl($childNode)}">- at this point, $childNode points to a node, so to get the correct link, you should use $childNode/@id
But that's not really the problem, I'm guessing?
/Chriztian
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.