Copied to clipboard

Flag this post as spam?

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


  • Joel 40 posts 62 karma points
    Apr 29, 2011 @ 13:41
    Joel
    0

    Looking for a dropdown navigation menu

    Hi all,

    As new Umbraco user I came across a problem: I can't find a dropdown menu which shows it's subitems upon mouseover.

    I'm using the Koiak Basic Website package to get myself familiar with Umbraco. Does anyone knows a good project offering a good dropdown menu?

     

    thanks

     

  • Johan Plesner Hamann 105 posts 199 karma points
    Apr 30, 2011 @ 01:01
    Johan Plesner Hamann
    0

    no but if you find a jquery dropdown menu, you could very easily make one yourself.<\p>

    /Johan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 30, 2011 @ 08:08
    Jan Skovgaard
    0

    Hi Joel

    As Johan is saying there is no dropdown menu you can use out of the box.

    You can generate the desired menu structure by using either a XSLT or razor macro.

    Then you need to add the prefered styling yourself and create the desired effect using either CSS only or on combination with jQuery.

    Hope this helps. If you are in doubt about how to do this please let us know.

    /Jan

  • Joel 40 posts 62 karma points
    May 02, 2011 @ 08:43
    Joel
    0

    Thanks for the replies,

    In the end I found the Superfish jQuery and managed to built adjust one of the XSLT's available. I think a good ready-to-use menu package would help a lot of new users. Saves a lot of time searching for the answer :)

     

  • Sean 64 posts 116 karma points
    May 10, 2011 @ 19:31
    Sean
    1

    Hey Joel, I don't suppose you would be willing to share with me your dropdown menu? :-)  I am looking to use one myself...

    Sean.

  • Joel 40 posts 62 karma points
    May 11, 2011 @ 09:47
    Joel
    0

    Not a problem Sean :)

    As said, I´m using the Superfish JQuery together with an adjusted sitemap.xslt for my dropdown menu. For the Superfish script; http://users.tpg.com.au/j_birch/plugins/superfish/ For the .xslt I´m using, see the code below. 

    Attach the .xslt to a macro, add your jscript in your site as described by superfish. 

    Just give a shout, if you need any help.

    <?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">
      <ul class="sf-menu-home">
    <li><href="/" class="firstlink">Home</a></li>
    </ul>
    <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 class="sf-menu">
      
      <xsl:for-each select="$parent/*
     [@isDoc and string(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 string(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>
  • Johan Plesner Hamann 105 posts 199 karma points
    May 11, 2011 @ 10:19
    Johan Plesner Hamann
    0

    If I can figure it out I'll make a package with some jquery dropdown menu.

    /Johan

  • Sean 64 posts 116 karma points
    May 11, 2011 @ 14:44
    Sean
    0

    Thanks for the info Joel! It is much appreciated. :-)  Could you elaborate when you say "Attach the .xslt to a macro"? I'm afraid I'm still relatively new to Umbraco, so any further help would be great.

    Thanks,
    Sean

  • Joel 40 posts 62 karma points
    May 11, 2011 @ 15:10
    Joel
    0

    Create a new Macro in the development section.

    And select the .xslt which contains the code above at "Use XSLT file"

    This will determine that the macro gets its info from the selected .xslt file. As you can see, you can also add user controls to a macro.

  • Sean 64 posts 116 karma points
    May 12, 2011 @ 19:08
    Sean
    0

    Thanks again Joel for the feedback, I'm pretty impressed with the things you can do with this platform. :-)

  • Søren Klemensen 16 posts 36 karma points
    Jul 19, 2011 @ 14:27
    Søren Klemensen
    0

    The one at superfish looks solid to me and i would hear how to intergrete it. Should i make the Superfish.css, Superfish.js and the hoverinter.js first ?

    Joel also posted som XSLT that he says to attach to a makro. but when i save i get following error:

    (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, IList`1 parent)
    at

    (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\umbraco\webservices\codeEditorSave.asmx.cs:line 124

Please Sign in or register to post replies

Write your reply to:

Draft