<!-- Input the documenttype you want here --> <xsl:variable name="level" select="2"/>
<xsl:template match="/">
<!-- The fun starts here --> <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"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">selected</xsl:attribute> </xsl:if> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul>
</xsl:template>
</xsl:stylesheet>
I tried using this but it doesn't display anything.
Woops...I appoligize for not being fully awake when writing my first post - that of course defines what level the navigation should be starting from not the depth. Do'h!
Maybe you should have a look at the predefined sitemap xslt that appears in the dropdown when creating a new XSLT file? - In here you can define the depth that the sitemap should go to...
Basically it writes out ul's nested in each other. It should be a matter of changing the $currentPage parameter to modify it to your needs I guess.
But perhaps someone else in here has a better solution (I know there are better ways to do this and will post later if no one does before me, just need to get to another machine first).
Third/fourth level nav
Hello. I'm using one of the default sub-nav XLST provided by Umbraco to list my sub nav. But it only goes down a couple of levels.
Here is my setup
Home
> About us
> Profiles
> Profile 1
> Profile 2
> Something Else
At the moment if I go to About us or Profiles, the sub-menu is correct. However it does not display the Profile 1 navigation.
Does that make sense?
Here is my current code:
I tried using this but it doesn't display anything.
http://our.umbraco.org/forum/templating/templates-and-document-types/6730-Third-level-in-menu-disappears
Thanks for any help!
Hi Tom
I guess it's because the level attribute has been set to '2'? Try changing this value to either 3 or 4. Does it work then?
/Jan
If I change it to 3 then the menu only displays when on the "Profile 1" page.
So guessing I need a more complicated XLST?
Hi Tom
Woops...I appoligize for not being fully awake when writing my first post - that of course defines what level the navigation should be starting from not the depth. Do'h!
Maybe you should have a look at the predefined sitemap xslt that appears in the dropdown when creating a new XSLT file? - In here you can define the depth that the sitemap should go to...
Basically it writes out ul's nested in each other. It should be a matter of changing the $currentPage parameter to modify it to your needs I guess.
But perhaps someone else in here has a better solution (I know there are better ways to do this and will post later if no one does before me, just need to get to another machine first).
/Jan
is working on a reply...