I am new to XSLT and I'm having a problem generating a sublevel menu.
I'm using the following structure:
Menu-item 1
Page 1
SubPage 1
SubPage 2
Page 2
Menu-item 2
When i'm on subpage 2 I want a list of all the pages under Page 1. So I thought I could generate a list based on the parentID. But somehow that won't work:
Level 3 navigation
I am new to XSLT and I'm having a problem generating a sublevel menu.
I'm using the following structure:
Menu-item 1
Page 1
SubPage 1
SubPage 2
Page 2
Menu-item 2
When i'm on subpage 2 I want a list of all the pages under Page 1. So I thought I could generate a list based on the parentID. But somehow that won't work:
This is the code I'm using:
<xsl:template match="/">
<xsl:for-each select="$currentPage/@parentID/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</xsl:template>
Thanks in advance.
Hi Rik,
Do you mean you are making a Top Nvagitaion Menu with 3 levels?
Fuji
Hi Fuji,
No, i want that if the user is on SubPage 2, he sees a list of all the pages under the parent page (page 1).
So in this example the user sees a list of SubPage 1 and SubPage 2.
Tnx!
Rik
Rik,
So you are looking for something like a breadcrumb but instead it will display the list of items under page1 ~ Subpage 1 + Subpage 2?
Hi Fuji,
You could try this out.
Here it will loop through all the child nodes (including itself) within the same parent node.
This way you could get both subpage 1 and subpage 2, being at subpage 1 or subpage 2
Fuji, Praveity thank you a lot. It works!!
For future reference: Where is the @isDoc value for?
Tnx!
Rik,
Try this out by using a XSLT breadCrumb.
Tnx Fuji. Both solutions worked :)
is working on a reply...