Copied to clipboard

Flag this post as spam?

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


  • Aditya.A 77 posts 96 karma points
    Oct 19, 2011 @ 11:33
    Aditya.A
    0

    How to create Dynamic menu

    Hi guys how can i create a drop menu like in http://www.sandisk.com/

    Newly added pages should display in the menu automatically.also how can i write logic for loing page and where should i do that??

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 19, 2011 @ 11:52
    Fuji Kusaka
    0

    Hi,

    If you are planning to make a drop menu in xslt this should get you working assuming you have your content structured like this

    - Content
    -- Default
    --- Link 1
    --- Link 2

    <xsl:variable name="level" select="1"/>   <!-- where Level 1 will be Default  node -->  

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul >  
    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
       <li>
             <href="{umbraco.library:NiceUrl(@id)}">        
         <xsl:value-of select="@nodeName"/>
            </a>    
        <!-- Drop Down Menu -->    

        <xsl:if test="*[@isDoc][not(umbracoNaviHide = 1)]">
          <ul>
            <xsl:for-each select="./* [@isDoc and string(umbracoNaviHide) !='1']">
               <li>
                <href="{umbraco.library:NiceUrl(@id)}">
                 <xsl:attribute name="class">
                    <xsl:if test="*[@isDoc][not(umbracoNaviHide = 1)]">
                      <xsl:textsubLnk</xsl:text> <!-- Where you will have you child nodes indended -->
                    </xsl:if>
                  </xsl:attribute>
                  <xsl:value-of select="@nodeName"/>
     </a
              </li>
            </xsl:for-each>
          </ul>
        </xsl:if>    <!-- End Of Drop Down Menu -->
      </li>
    </xsl:for-each>
    </ul> 

     Hope this will help you

Please Sign in or register to post replies

Write your reply to:

Draft