List "same level" nodes Options
weharms
Posted: Friday, August 15, 2008 9:04:48 PM

Rank: Newbie

Joined: 4/18/2008
Posts: 6
Location: Netherlands
Hi,

I'm currently building a website with 4 "sub" sites;

Content
Site1
Site2
Site3
Site4


Now i'm trying to create a navigation XSLT which onlu contains de Site (1-4).

Stupid as i am i didn't succeed, hopefully any here can help me.
I know the problem is in the for-each... but i jist cant get the "parent-sub-nodes".


The (stripped) XSLT i used ;

<blahblahblah>



<xsl:template match="/">
<ul class="menu">
<xsl:for-each select="$currentPage/parent::node">
<li class="menu">
<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/> </a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>


</blahblahblah>



Thanks for any clues...


gr. Walter

Walter E. Harms - level 2 certified
Chopin Software Development

“The journey of a thousand miles begins with a single step”.
Dirk
Posted: Friday, August 15, 2008 9:34:05 PM

Rank: Addict

Joined: 9/27/2007
Posts: 977
Location: Belgium
Hi Walter,

I'm guessing that Site1-4 are subnodes of the Content node, right? If that is the case, use following for-each statement:

Code:
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=1]/node">
...
</xsl:for-each>


Hope that helps.

Regards,
/Dirk



level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
weharms
Posted: Saturday, August 16, 2008 7:40:23 AM

Rank: Newbie

Joined: 4/18/2008
Posts: 6
Location: Netherlands
Hi Dirk,

thanks for your reply. What you suggested is what i initialy thought however, only the subnodes of the current site are shown. I found the correct for-each...

Code:
<xsl:for-each select="$currentPage/ancestor::root/node">


Thanks for your help!


gr. Walter

Walter E. Harms - level 2 certified
Chopin Software Development

“The journey of a thousand miles begins with a single step”.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.