Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I just upgraded to 4.5.1 and my main navigation is broken. I can't find the problem, can anyone help?
Best regards,
Stefan
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " ">]><xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:msxml="urn:schemas-microsoft-com:xslt"xmlns:umbraco.library="urn:umbraco.library"exclude-result-prefixes="msxml umbraco.library"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:param name="startLevel" select="2"/> <xsl:template match="/"> <xsl:if test="count($currentPage/ancestor-or-self::*[@isDoc] [@level = $startLevel]/node) > 0"> <xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc] [@level=$startLevel]/node [string(umbracoNaviHide) != '1']"> <xsl:call-template name="drawnode"> <xsl:with-param name="level" select="2"/> </xsl:call-template> </xsl:for-each> </xsl:if> </xsl:template> <xsl:template name="drawnode"> <xsl:param name="level"/> <li> <xsl:choose> <xsl:when test="@id=$currentPage/@id"> <xsl:if test="$level = 2"> <xsl:attribute name="class">secondlevelliselected</xsl:attribute> </xsl:if> <xsl:if test="$level = 3"> <xsl:attribute name="class">thirdlevelliselected</xsl:attribute> </xsl:if> <xsl:if test="$level = 4"> <xsl:attribute name="class">frothlevelliselected</xsl:attribute> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$level = 2"> <xsl:attribute name="class">secondlevelli</xsl:attribute> </xsl:if> <xsl:if test="$level = 3"> <xsl:attribute name="class">thirdlevelli</xsl:attribute> </xsl:if> <xsl:if test="$level = 4"> <xsl:attribute name="class">forthlevelli</xsl:attribute> </xsl:if> </xsl:otherwise> </xsl:choose> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:choose> <xsl:when test="@id=$currentPage/@id"> <xsl:if test="$level = 2"> <xsl:attribute name="class">secondLevelSelected</xsl:attribute> </xsl:if> <xsl:if test="$level = 3"> <xsl:attribute name="class">thirdLevelSelected</xsl:attribute> </xsl:if> <xsl:if test="$level = 4"> <xsl:attribute name="class">forthLevelSelected</xsl:attribute> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$level = 2"> <xsl:attribute name="class">secondLevel</xsl:attribute> </xsl:if> <xsl:if test="$level = 3"> <xsl:attribute name="class">thirdLevel</xsl:attribute> </xsl:if> <xsl:if test="$level = 4"> <xsl:attribute name="class">forthLevel</xsl:attribute> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:value-of select="@nodeName"/> </a></li> <xsl:if test="count(descendant-or-self::*[@isDoc] [@id=$currentPage/@id]) > 0 "> <xsl:for-each select="*[@isDoc] [string(umbracoNaviHide) != '1']"> <xsl:call-template name="drawnode"> <xsl:with-param name="level" select="$level +1"/> </xsl:call-template> </xsl:for-each> </xsl:if> </xsl:template></xsl:stylesheet>
Hi Stefan,
You've got a couple of "node" references in there that hasn't been updated to *[@isDoc] (in the two lines following match="/")
/Chriztian
Thanks a lot Chriztian.
worked like a charm :)
Please mark as solved, thank you :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Navigation is broken after upgrade to 4.5
Hi,
I just upgraded to 4.5.1 and my main navigation is broken. I can't find the problem, can anyone help?
Best regards,
Stefan
<?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"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:param name="startLevel" select="2"/>
<xsl:template match="/">
<xsl:if test="count($currentPage/ancestor-or-self::*[@isDoc] [@level = $startLevel]/node) > 0">
<xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc] [@level=$startLevel]/node [string(umbracoNaviHide) != '1']">
<xsl:call-template name="drawnode">
<xsl:with-param name="level" select="2"/>
</xsl:call-template>
</xsl:for-each>
</xsl:if>
</xsl:template>
<xsl:template name="drawnode">
<xsl:param name="level"/>
<li>
<xsl:choose>
<xsl:when test="@id=$currentPage/@id">
<xsl:if test="$level = 2">
<xsl:attribute name="class">secondlevelliselected</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 3">
<xsl:attribute name="class">thirdlevelliselected</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 4">
<xsl:attribute name="class">frothlevelliselected</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$level = 2">
<xsl:attribute name="class">secondlevelli</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 3">
<xsl:attribute name="class">thirdlevelli</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 4">
<xsl:attribute name="class">forthlevelli</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:choose>
<xsl:when test="@id=$currentPage/@id">
<xsl:if test="$level = 2">
<xsl:attribute name="class">secondLevelSelected</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 3">
<xsl:attribute name="class">thirdLevelSelected</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 4">
<xsl:attribute name="class">forthLevelSelected</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$level = 2">
<xsl:attribute name="class">secondLevel</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 3">
<xsl:attribute name="class">thirdLevel</xsl:attribute>
</xsl:if>
<xsl:if test="$level = 4">
<xsl:attribute name="class">forthLevel</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="@nodeName"/>
</a>
</li>
<xsl:if test="count(descendant-or-self::*[@isDoc] [@id=$currentPage/@id]) > 0 ">
<xsl:for-each select="*[@isDoc] [string(umbracoNaviHide) != '1']">
<xsl:call-template name="drawnode">
<xsl:with-param name="level" select="$level +1"/>
</xsl:call-template>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Hi Stefan,
You've got a couple of "node" references in there that hasn't been updated to *[@isDoc] (in the two lines following match="/")
/Chriztian
Thanks a lot Chriztian.
worked like a charm :)
Please mark as solved, thank you :)
is working on a reply...