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
How do I make it so that menus that are marked as "hide from navigation" gets hidden from the navigation?
Here is my code:
<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" xmlns:Examine="urn:Examine" exclude-result-prefixes="msxml umbraco.library Examine "> <xsl:output method="xml" omit-xml-declaration="yes" /> <xsl:param name="currentPage"/> <!-- 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="1"/> <xsl:template match="/"> <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <div class="icon"> <span class="icon-bar"> </span> <span class="icon-bar"> </span> <span class="icon-bar"> </span> </div> </a> <h3> Navigation</h3> <div class="nav-collapse collapse"> <ul id="topNavigation" class="nav"> <li class="home"> <xsl:if test="$currentPage/@id = $currentPage/ancestor-or-self::* [@level=$level]/@id"> <xsl:attribute name="class">home current</xsl:attribute> </xsl:if> <a href="/">Home</a> </li> <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <xsl:if test="@id = $currentPage/@id"> <xsl:attribute name="class">current</xsl:attribute> </xsl:if> <a class="navigation" href="{umbraco.library:NiceUrl(@id)}"> <span> <xsl:value-of select="@nodeName"/> </span> </a> </li> </xsl:for-each> </ul> </div> </div> </div> </div> </xsl:template>
Hi Johan,
If your code is correct, then you should simply add a property on your document type for the texpages with the alias of umbracoNaviHide or any other document types where you want the user to be able to hide some pages.
You should use the data type of "True/false".
Hope this helps,
/Dennis
Thank you Dennis!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Hide from navigation
How do I make it so that menus that are marked as "hide from navigation" gets hidden from the navigation?
Here is my code:
Hi Johan,
If your code is correct, then you should simply add a property on your document type for the texpages with the alias of umbracoNaviHide or any other document types where you want the user to be able to hide some pages.
You should use the data type of "True/false".
Hope this helps,
/Dennis
Thank you Dennis!
is working on a reply...