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:
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:
- 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...