I new at umbraco and have taken over a website build in umbraco. Therefor i hope for some help.
Im interesting at makeing a dropdown menu on the website and im being told to integrate it at my nav xslt. But i tried sevaral times but im getting som errors.
my current nav xslt is build on some macros, and i want to keep im, but add some more topic in the menu. Is it possible and how?
Sry about the spelling getting and error in my edt.
Hi all
I am new at umbraco and have taken over a website build in umbraco. Therefor i hope for some help.
Im interesting at makeing a dropdown menu on the website and im being told to integrate it at my nav xslt. But i tried sevaral times and im getting som errors.
my current nav xslt is build on some macros, and i want to keep im, but add some more topic in the menu. Is it possible and how?
im here posting my Xslt;
CODE
I hope someone can help or give me some tips. if you want to see the page, its on www.dype.dk
I have looked at Superfish, but failed to integrete it.
Yes its www.dype.dk im working on, and as i understand you have to make the menu in the xslt as there is already made some macro's due to the current side menu structure.
If i make it in the template it wont be dynamic. Therefore i hope that someone can help me solve how to. I just one simple, e.g. Superfish basic. The site have already a dropdown in statestik, but its different as its collecting some data.
My reason for dropdown is that i want more topics and it will save space.
Soren, it all depends what you are looking for. If you want a dynamic menu with drop down menu i would go for XSLT and use it in a template. Now from what i understand you just want a simple menu with drop downs ??
You can try by creating a XSLT by Level and try this..
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <a href="umbraco.library:NiceUrl(@id)"> <xsl:value-of select="@nodeName"/> </a> <!-- Drop Down Menu --> <xsl:if test="count(./*[@isDoc and string(umbracoNaviHide) !='1'])>0"> <ul> <xsl:for-each select="./* [@isDoc and string(umbracoNaviHide) !='1']"> <li> <a href="umbraco.library:NiceUrl(@id)"> <xsl:value-of select="@nodeName"/></a> </li> </xsl:for-each> </ul> </xsl:if>
<!-- End Of Drop Down Menu --> </li> </xsl:for-each> </ul>
I have no tried it, but its like my menu is being vertical. Is it because i havde to change the content? i just want i like :http://users.tpg.com.au/j_birch/plugins/superfish/#examples
If i write it in the current Nav XSLT to one complete it looks like this right?
<!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <a href="umbraco.library:NiceUrl(@id)"> <xsl:value-of select="@nodeName"/> </a> <!-- Drop Down Menu --> <xsl:if test="count(./*[@isDoc and string(umbracoNaviHide) !='1'])>0"> <ul> <xsl:for-each select="./* [@isDoc and string(umbracoNaviHide) !='1']"> <li> <a href="umbraco.library:NiceUrl(@id)"> <xsl:value-of select="@nodeName"/></a> </li> </xsl:for-each> </ul> </xsl:if> <!-- End Of Drop Down Menu --> </li> </xsl:for-each> </ul>
i also tried the one you linked to, but then nothing happends. i wrote it in the nav.xslt , in my master template. But i can still not create any in my content tree.
I would like to look like this:
I cant see where im wrong.. There must be something im missing
Sorry to "drop in" in the middle of your discussion, but I have a suggestion for a solution :-)
I can see your Umbraco installation isn't all new, it uses the old XSLT schema.
I have made a lot of dropdown menus in XSLT. Try make a new XSLT file, select Sitemap as the template. That'll create the basic XSLT you need: a list with all the pages.
Thanx for your input. I create a new XSLT and select sitemap i get following error
both with id or class
Error occured
System.Xml.XmlException: 'at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2) at System.Xml.XmlTextReaderImpl.ParseEndElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Xsl.Xslt.XsltInput.ReadNextSiblingHelper() at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling() at System.Xml.Xsl.Xslt.XsltInput.MoveToNextSibling() at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList) at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
I have include your text and my xslt looks like this:
dropdown menu in Xslt
Hi all
I new at umbraco and have taken over a website build in umbraco. Therefor i hope for some help.
Im interesting at makeing a dropdown menu on the website and im being told to integrate it at my nav xslt. But i tried sevaral times but im getting som errors.
my current nav xslt is build on some macros, and i want to keep im, but add some more topic in the menu. Is it possible and how?
im here posting my Xslt;
I hope someone cal helt or give me some tips. if you want to see the page, its on www.dype.dk
I have looked at Superfish, but failed to integrete it.
Sry about the spelling getting and error in my edt.
Hi all
I am new at umbraco and have taken over a website build in umbraco. Therefor i hope for some help.
Im interesting at makeing a dropdown menu on the website and im being told to integrate it at my nav xslt. But i tried sevaral times and im getting som errors.
my current nav xslt is build on some macros, and i want to keep im, but add some more topic in the menu. Is it possible and how?
im here posting my Xslt;
CODE
I hope someone can help or give me some tips. if you want to see the page, its on www.dype.dk
I have looked at Superfish, but failed to integrete it.
Hi Soren,
Is the website www.dype.dk the one you are working on?..are do you intend to implement in the navigation?
//fuji
Hi Fuji.
Yes its www.dype.dk im working on, and as i understand you have to make the menu in the xslt as there is already made some macro's due to the current side menu structure.
If i make it in the template it wont be dynamic. Therefore i hope that someone can help me solve how to. I just one simple, e.g. Superfish basic. The site have already a dropdown in statestik, but its different as its collecting some data.
My reason for dropdown is that i want more topics and it will save space.
- Soren
Soren, it all depends what you are looking for. If you want a dynamic menu with drop down menu i would go for XSLT and use it in a template. Now from what i understand you just want a simple menu with drop downs ??
You can try by creating a XSLT by Level and try this..
I have no tried it, but its like my menu is being vertical. Is it because i havde to change the content? i just want i like :http://users.tpg.com.au/j_birch/plugins/superfish/#examples
If i write it in the current Nav XSLT to one complete it looks like this right?
<?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"/>
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="umbraco.library:NiceUrl(@id)">
<xsl:value-of select="@nodeName"/>
</a>
<!-- Drop Down Menu -->
<xsl:if test="count(./*[@isDoc and string(umbracoNaviHide) !='1'])>0">
<ul>
<xsl:for-each select="./* [@isDoc and string(umbracoNaviHide) !='1']">
<li>
<a href="umbraco.library:NiceUrl(@id)">
<xsl:value-of select="@nodeName"/></a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
<!-- End Of Drop Down Menu -->
</li>
</xsl:for-each>
</ul>
<!-- start writing XSLT -->
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']">
<xsl:choose>
<xsl:when test="@nodeType != '1492'">
<li class="mega"><a href="{umbraco.library:NiceUrl(@id)}" class="topNavi"><font class="head"><xsl:value-of select="@nodeName"/></font><br/><font class="sub"><xsl:value-of select="data [@alias='underheadline']" disable-output-escaping="yes"/></font></a></li>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="link" select="data [@alias='linktotournament']" />
<li class="mega"><a href="{$link}" target="_blank" class="topNavi"><font class="head"><xsl:value-of select="@nodeName"/></font><br/><font class="sub"><xsl:value-of select="data [@alias='underheadline']" disable-output-escaping="yes"/></font></a></li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Soren, give this a try then all you will need to make the drop down to show is some css. Or you can also have a look at this post http://our.umbraco.org/forum/developers/xslt/22375-Xslt-and-Superfish-menu
Hi again
i also tried the one you linked to, but then nothing happends. i wrote it in the nav.xslt , in my master template. But i can still not create any in my content tree.
I would like to look like this:
I cant see where im wrong.. There must be something im missing
Hi Soren, can you show us your XSLT and how your Content Structure Looks like?
Hi Søren,
Sorry to "drop in" in the middle of your discussion, but I have a suggestion for a solution :-)
I can see your Umbraco installation isn't all new, it uses the old XSLT schema.
I have made a lot of dropdown menus in XSLT. Try make a new XSLT file, select Sitemap as the template. That'll create the basic XSLT you need: a list with all the pages.
You can use XSLT to check witch page is currently viewed.
From here it's mostly CSS you need to do. Here you have an example:
Now - according to your link - all you have to do is calling the script and connect it to the <ul id="mainMenu">.
Arh... sorry, the html sample should contain <ul id="mainMenu"> not <ul class="mainMenu">
And it seems like Our has deleted some spaces in the css sample...
Hi Kasper
Thanx for your input. I create a new XSLT and select sitemap i get following error
both with id or class
Error occured
System.Xml.XmlException: 'at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Xsl.Xslt.XsltInput.ReadNextSiblingHelper()
at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling()
at System.Xml.Xsl.Xslt.XsltInput.MoveToNextSibling()
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet)
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList)
at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet()
at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument()
at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
I have include your text and my xslt looks like this:
/Hey Soren, have you been able to get the navigation working?if not ill try to help you again. And btw what version of umbraco are you on?
I finally got something that worked:
- you can see the temperary work on www.dype.dk. Thanx for your help!!
</xsl:stylesheet>
is working on a reply...