I currently have the xslt below for my top level navigation which works fine until I go to a level 2 page at which point the code reads all level 2 nodes.
I need the top navigation to read level 1 nodes at all times regardless of current page.
Can anyone suggest something
Thanks
JG
<xsl:template match="/"> <!-- The fun starts here --> <xsl:for-each select="$currentPage/../* [@isDoc][not(umbracoNaviHide = 1)]"> <div class="nav_button"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="Exslt.ExsltStrings:uppercase(@nodeName)"/> </a> </div> </xsl:for-each> </xsl:template>
You can use one of the bulid in templaes to get what you are looking for.
You can use the template Navigation prototype.
The template contains the following code,
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @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>
List Level1 nodes
Hi
I currently have the xslt below for my top level navigation which works fine until I go to a level 2 page at which point the code reads all level 2 nodes.
I need the top navigation to read level 1 nodes at all times regardless of current page.
Can anyone suggest something
Thanks
JG
Hey,
Create a new xslt file and select the "Navigation Prototype" tempalte, this will give you the code you need.
Rich
Hi JG,
You can use one of the bulid in templaes to get what you are looking for.
You can use the template Navigation prototype.
The template contains the following code,
I hope you will get it work.
/Dennis
is working on a reply...