Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi!
Im using the Runway Topnavigation to display my top nodes.
Ive created a submenu and now wants the Top Parent node in the RunwayTopNavigation to be selected so its easy to see under which section the user is.
Today my xslt looks like this:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here --><xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here --><ul id="topnavigation"><!-- <xsl:choose> <xsl:when test="$currentPage/@id='1055'"> <div class="MenuItemSelected"> <li> <div class="MenuLinkText"> <a href="hem.aspx">Startsidan</a> </div> </li> </div> </xsl:when> <xsl:otherwise> <div class="MenuItem"> <li> <div class="MenuLinkText"> <a href="hem.aspx">Startsidan</a> </div> </li> </div> </xsl:otherwise> </xsl:choose>--><!--<li><a href="/">Hem</a></li>--><xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [@nodeTypeAlias != 'Nyheter'][string(data [@alias='umbracoNaviHide']) != '1' and @nodeName != 'Kundsidor']"> <xsl:choose> <xsl:when test="$currentPage/@id=@id"> <div class="MenuItemSelected"> <li> <div class="MenuLinkText"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </div> </li> </div> </xsl:when>
<xsl:otherwise> <div class="MenuItem"> <li> <div class="MenuLinkText"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </div> </li> </div> </xsl:otherwise> </xsl:choose> </xsl:for-each></ul>
</xsl:template>
</xsl:stylesheet>
This way I can change the layout for the selected item, but only in the first level.
Hi,
It may be worth looking at this navigation package, which supports this out of the box:
http://our.umbraco.org/projects/cogworks---flexible-navigation
T
Of course I could have used it but since I styled my menu so nice I didnt want to start over with css:ing :)
It was quite easy actually I changed the for-each like this:
<xsl:when test="$currentPage/@id=@id or $currentPage/ancestor-or-self::node/@id=@id">
Worked like a charm!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Set MenuItem as Selected when Subnode is selected
Hi!
Im using the Runway Topnavigation to display my top nodes.
Ive created a submenu and now wants the Top Parent node in the RunwayTopNavigation to be selected so its easy to see under which section the user is.
Today my xslt looks like this:
This way I can change the layout for the selected item, but only in the first level.
Hi,
It may be worth looking at this navigation package, which supports this out of the box:
http://our.umbraco.org/projects/cogworks---flexible-navigation
T
Of course I could have used it but since I styled my menu so nice I didnt want to start over with css:ing :)
It was quite easy actually I changed the for-each like this:
Worked like a charm!
is working on a reply...