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 :)
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 " "> ]> <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><a 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 <= $maxLevelForSitemap and string(@template) != '0' and name() != 'HomeImage']"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/></a> <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevelForSitemap and string(@template) != '0' and name() != 'HomeImage']) > 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>
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.
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
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
no but if you find a jquery dropdown menu, you could very easily make one yourself.<\p>
/Johan
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
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 :)
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.
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.
If I can figure it out I'll make a package with some jquery dropdown menu.
/Johan
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
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.
Thanks again Joel for the feedback, I'm pretty impressed with the things you can do with this platform. :-)
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:
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
is working on a reply...