Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sam Woodcock 3 posts 23 karma points
    Oct 12, 2011 @ 16:03
    Sam Woodcock
    0

    remove file from nav

    hi im using this xslt to generate my menu, but i dont want certan files appering in the menu, how easy is it to do?

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
        <!ENTITY nbsp "&#x00A0;">
    ]>
    <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="/">
     <ul id="topNavigation">
           <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>
             <href="/">Home</a>
           </li>
          <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
      <li>
         <xsl:if test="contains($currentPage/@path,@id)">
            <xsl:attribute name="class">current</xsl:attribute>
          </xsl:if>
        <href="{umbraco.library:NiceUrl(@id)}">
          <span><xsl:value-of select="@nodeName"/></span>
        </a>
      </li>
    </xsl:for-each>
    </ul>
        </xsl:template>
    </xsl:stylesheet>

  • Matt Barlow | jacker.io 164 posts 740 karma points c-trib
    Oct 12, 2011 @ 16:10
    Matt Barlow | jacker.io
    0

    You need to add a property to your doctypes with the alias umbracoNaviHide.



  • Sam Woodcock 3 posts 23 karma points
    Oct 12, 2011 @ 16:16
    Sam Woodcock
    0

    ah cheers, 

Please Sign in or register to post replies

Write your reply to:

Draft