Already have this xslt to show menu at level 3 when at level 3:
en - Page A ( Level 1 ) - Sub Page A ( Level 2 ) - Sub Sub Page A 1 (Level 3) - Sub Sub Page A 2 (Level 3) - Page B ( Level 1 ) - Sub Page B ( Level 2 ) - Sub Page B ( Level 2 )
But some pages have only 2 levels and I want to show the sub nav also..
So what I want to do is depending on what level you are 2, 3, or maybe 4 show the sub navs on those levels.
Show sub nav depending on level
Hi all maybe someone can help me with this:
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="3"/>
<xsl:template match="/">
<!-- The fun starts here -->
<div id="navSubMnu">
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
<xsl:attribute name="class">current</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="count(./*[@isDoc]) > 1 and string(linkToSubpage) = '1'">
<xsl:value-of select="umbraco.library:NiceUrl(./*[@isDoc]/@id)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="umbraco.library:NiceUrl(@id)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
Already have this xslt to show menu at level 3 when at level 3:
en
- Page A ( Level 1 )
- Sub Page A ( Level 2 )
- Sub Sub Page A 1 (Level 3)
- Sub Sub Page A 2 (Level 3)
- Page B ( Level 1 )
- Sub Page B ( Level 2 )
- Sub Page B ( Level 2 )
But some pages have only 2 levels and I want to show the sub nav also..
So what I want to do is depending on what level you are 2, 3, or maybe 4 show the sub navs on those levels.
Any advice
//Sam
No one?
Please
Hi Sam,
Try this, it should get you working. What you need to do here is to test if [@isDoc] is present just like you would with any navigation.
Add this line just after your <LI>
//fuji
is working on a reply...