I'm trying to use a nested for-each, basically I need the 'BundleTitle' of each item within our umbraco.config and then for each of thise titles I need the 'EventTitle' which exists for each 'BundleTitle', but I'm not having much success, can you help? This is what I have so far:
In the second for-each you have a duplicate "/node", shouldn't that be just one of them??
ancestor-or-self::root/node/node
By the way, instead of "::root" you might want to use "::node", in case you're ever going to do a multisite / multiple language versions for this site..
This should give you the node homepage-node of the $currentPage and then check in the tree for a node with a nodeName of Johann Strauss Gala. And the take the childnodes of the selected node.
Nested XSL for-each
Hi all,
I'm trying to use a nested for-each, basically I need the 'BundleTitle' of each item within our umbraco.config and then for each of thise titles I need the 'EventTitle' which exists for each 'BundleTitle', but I'm not having much success, can you help? This is what I have so far:
<xsl:for-each select="$currentPage/ancestor-or-self::root/node [@nodeTypeAlias='WhatsOn']/node">
<xsl:variable name="varBundleName" select="data [@alias = 'BundleTitle']"/>
<li><xsl:value-of select="data [@alias = 'BundleTitle']"/></li>
<xsl:for-each select="$currentPage/ancestor-or-self::root/node/node [@alias=$varBundleName]/node">
<xsl:value-of select="data [@alias = 'EventTitle']"/>
</xsl:for-each>
</xsl:for-each>
Thanks.
What is the result you're getting right now?
In the second for-each you have a duplicate "/node", shouldn't that be just one of them??
ancestor-or-self::root/node/node
By the way, instead of "::root" you might want to use "::node", in case you're ever going to do a multisite / multiple language versions for this site..
Hi Darryl
You could try to make some kind of debugging in your for-each. First of all try to check if the correct content is in your $varBuncleName like this:
If this one i empty, you should maybe try to create the variable like this:
If your variable contains the right content, just say so, and I'll have another look at it.
/Kim A
The variable contains the right name, I swapped the output for the variable name and it still works:
Hmm I just took the following XSL:
<li><xsl:value-of select="data [@alias = 'EventTitle']"/></li>
And put it into a separate XSLT File and it does pull back the event titles for that event...
I think it should work but it doesn't, any better ideas?
Hmm...
Could you try this one out:
This should give you the node homepage-node of the $currentPage and then check in the tree for a node with a nodeName of Johann Strauss Gala. And the take the childnodes of the selected node.
Hope this helps.
/Kim A
Genius - thank you sir!
You are very welcome.
/Kim A
is working on a reply...