Been searching the forums the last hour looking for an answer to how i get my level 0 (root) nodes liste with xslt for a toplevel navigation menu in the old schema.
Structure looks like this example:
- Domain 1 - Home - About - Vision - Domain 2 - Home - About - Vision - Domain 3
- Home
- About
- Vision
I started using the Prototype Navigation xslt, but when i set level=1 i get the nodes below Domain 1. If i set it to 0 i get nothing.
<!-- Input the documenttype you want here --> <!-- Typically '1' for topnavigtaion and '2' for 2nd level --> <!-- Use div elements around this macro combined with css --> <!-- for styling the navigation --> <xsl:variable name="level" select="2"/>
<xsl:template match="/">
<!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="style">font-weight: bold;</xsl:attribute> </xsl:if> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul>
Level 0 Navigation (Top level nodes)
Hi there
Been searching the forums the last hour looking for an answer to how i get my level 0 (root) nodes liste with xslt for a toplevel navigation menu in the old schema.
Structure looks like this example:
- Domain 1
- Home
- About
- Vision
- Domain 2
- Home
- About
- Vision
- Domain 3
- Home
- About
- Vision
I started using the Prototype Navigation xslt, but when i set level=1 i get the nodes below Domain 1. If i set it to 0 i get nothing.
XSLT:
Someone please delete this double post.
is working on a reply...