uComponents Multi-Node Tree Picker Recursive Macro
Hi,
Im having some trouble with making my uComponents Multi-Node Tree Picker recursive. I have setup the MNTP for selecting widgets in the side column, but would like those widgets to be recursive.
I have seen a post about making a macro recursive, but i couldn't follow the logic.
My XSLT is below.
Any help would be grateful
<xsl:param name="currentPage"/> <xsl:template match="/"> <xsl:for-each select="$currentPage/sideColumnWidgets/MultiNodePicker/nodeId"> <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" /> <!-- Handle the kind of node we got back --> <xsl:apply-templates select="$node" /> </xsl:for-each> </xsl:template>
The XPath for getting a property value recursively is like this:
$currentPage/ancestor-or-self::*[@isDoc and normalize-space(sideColumnWidgets/*/nodeId)][1]/sideColumnWidgets/*/nodeId
The idea here is with the "ancestor-or-self" part the XPath is looking at itself and everything above it (starting with itself). It then checks to see if it's a document (that's the @isDoc bit) and if it has a property (with a value) that matches "sideColumnWidgets/*/nodeId" (I swapped out the "MultiNodePicker" part with a wildcard, just because it makes the XPath too long). From there it grabs the first node [1] and uses that property value.
uComponents Multi-Node Tree Picker Recursive Macro
Hi,
Im having some trouble with making my uComponents Multi-Node Tree Picker recursive.
I have setup the MNTP for selecting widgets in the side column, but would like those widgets to be recursive.
I have seen a post about making a macro recursive, but i couldn't follow the logic.
My XSLT is below.
Any help would be grateful
Hi Martin,
Not sure if you still need help with this issue?
The XPath for getting a property value recursively is like this:
The idea here is with the "ancestor-or-self" part the XPath is looking at itself and everything above it (starting with itself). It then checks to see if it's a document (that's the @isDoc bit) and if it has a property (with a value) that matches "sideColumnWidgets/*/nodeId" (I swapped out the "MultiNodePicker" part with a wildcard, just because it makes the XPath too long). From there it grabs the first node [1] and uses that property value.
Hope that makes sense?
Cheers, Lee.
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.