Copied to clipboard

Flag this post as spam?

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


  • Mike 81 posts 101 karma points
    Oct 29, 2012 @ 21:24
    Mike
    0

    Left Nav Node Issue

    Hey Guru's, I am having an issue where my left nav always displays the children of one particular parent node. So if I go into the "about us" tab in the top navigation or the "contact us" tab, the left navigation will show the children for the "Projects" tab. Attached is my XSLT. Thanks for any assistance!!!!

     

    <?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <!-- update this variable on how deep your site map should be -->
    <xsl:variable name="maxLevelForSitemap" select="5"/>

    <xsl:template match="/">
    <div id="navigation">
    <div id="myjqueryLeftmenu" class="jquerycssLeftmenu">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc]/*"/>  
    </xsl:call-template>
    </div>
    </div>
    </xsl:template>

    <xsl:template name="drawNodes">
    <xsl:param name="parent"/> 
    <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
      <ul>     
    <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]"
      <li>  
    <a>
        <xsl:attribute name="href">
          <xsl:choose>
                  <xsl:when test="url/url-picker/url != ''">
                          <xsl:value-of select="url/url-picker/url"/>
                  </xsl:when>
                  <xsl:otherwise>
                          <xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
                  </xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <xsl:value-of select="@nodeName"/>
    </a
    <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]) &gt; 0">   
    <xsl:call-template name="drawNodes">    
    <xsl:with-param name="parent" select="."/>    
    </xsl:call-template>  
     </xsl:if>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
  • Mike 81 posts 101 karma points
    Oct 29, 2012 @ 21:43
    Mike
    0

    I would like to add that I want the left nav to show all the children of the original top nav parent at all times. 

     

Please Sign in or register to post replies

Write your reply to:

Draft