I've done many search (manybe wrong) and I think I come to topics responding for previous version of Umbraco so, I'm a little confused...
I have a Content structure as
Default Projects Contacts etc...
I need to do a simple for-each select using a known path of a node in xslt. I've tried somethings like <xsl:for-each select="//Default/Projects">
or <xsl:for-each select="$currentPage/ancestor-or-self::root/* [@nodeName = 'Projets']/nodes">
for-each select by path
Hi all,
I've done many search (manybe wrong) and I think I come to topics responding for previous version of Umbraco so, I'm a little confused...
I have a Content structure as
Default
Projects
Contacts
etc...
I need to do a simple for-each select using a known path of a node in xslt. I've tried somethings like
<xsl:for-each select="//Default/Projects">
or
<xsl:for-each select="$currentPage/ancestor-or-self::root/* [@nodeName = 'Projets']/nodes">
but with no results.
Anybody have a hint ?
Thanks in advance.
NF
Try this:
<xsl:for-each select="$currentPage/* [name() = 'Projects']">
But if you know the path and it's only one node just do this:
<xsl:variable name="projectsNode" select="$currentPage/* [name() = 'Projects' and position() = 1]"/>
looks like it should work.
Hi,
thanks for your answer but, it seems not to work... my Projects node is in the root node, not necessarly in the $currentPage.
A simple test like this :
is not working.
NF
Hi Nico
If you want to iterate through the childnodes of the "Projects"-node you should be able to use this piece og code:
/Kim A
Hi Nico
Did you ever find a solution to this problem?
/Kim A
is working on a reply...