Copied to clipboard

Flag this post as spam?

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


  • Ben Price 15 posts 35 karma points
    Feb 02, 2011 @ 07:14
    Ben Price
    0

    Making Navigation Drop Down to Secondary level

    I am using the Kojak Basic Site as my basis, but need the navigation to use drop downs to show the secondary pages.  How do I go about accomplishing this?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 02, 2011 @ 08:46
    Jan Skovgaard
    0

    Hi Ben

    I must admit that I don't know how the navigation works in this package. But if all the levels are printed in the navigation then it should just be a matter of styling it with CSS to make sure level 2 (or is it 3?) is not being displayed untill hover occurs.

    But maybe it's easier to help you out if you could post a XSLT snippet.

    Cheers

    /Jan

  • Ben Price 15 posts 35 karma points
    Feb 02, 2011 @ 08:48
    Ben Price
    0

    This did it, thank you for the speedy reply though!

    <?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="6"/>

    <xsl:template match="/">
    <div id="sitemap">
    <xsl:call-template name="drawNodes">  
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level=1]"/>  
    </xsl:call-template>
    </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 umbracoNaviHide != '1' and @level &lt;= 
    $maxLevelForSitemap and string(@template) != '0' and name() != 
    'HomeImage']">
        
    <li>  
    <href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/></a>  
    <xsl:if test="count(./*
     [@isDoc and umbracoNaviHide != '1' and @level &lt;= 
    $maxLevelForSitemap and string(@template) != '0' and name() != 
    'HomeImage']) &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>

Please Sign in or register to post replies

Write your reply to:

Draft