Copied to clipboard

Flag this post as spam?

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


  • Robcoz 1 post 21 karma points
    Jun 21, 2014 @ 00:18
    Robcoz
    0

    Menu - submenu depending on the main menu

    Hi,

     

    On my website I have menu like this:

    Menu1
    - menu
    - menu
    - menu
    Menu 2
    - menu
    - menu

    I would like to create something like: On homepage you can see only Menu1, Menu2 etc...
    When you clikc Menu2 you go to selected page and here you see:
    Menu1
    Menu2
    - menu
    - menu

    How I can make that? At this moment this is my code and I see every main menu and submenu.

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


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

    <xsl:param name="currentPage"/>

    <xsl:variable name="maxLevelForSitemap" select="6"/>

    <xsl:template match="/">
    <xsl:param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level=3]"/>
    <div class="section-title text-indent"><xsl:value-of select="$parent/@nodeName"/></div>
    <div class="light-blue-gradient-background-210 side-menu">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level = 3]"/>
    </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 string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]">
    <xsl:if test="$currentPage/@id = current()/@id">
    <xsl:attribute name="class">active</xsl:attribute>
    </xsl:if>
    </xsl:for-each>
    <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]">
    <li>
    <xsl:if test="$currentPage/@id = current()/@id">
    <xsl:attribute name="class">active</xsl:attribute>
    </xsl:if>
    <xsl:if test="@nodeTypeAlias != 'MenuCycle'">
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:if test="$currentPage/@id = current()/@id">
    <xsl:attribute name="class">active</xsl:attribute>
    </xsl:if>
    <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>
    </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