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 have a submenu that works fine with 2 levels but I'm not sure it's the right way to do it. Here is my code:
<?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:template match="/"> <xsl:variable name="level" select="2"/> <xsl:variable name="rootTextpageNode" select="$currentPage/ancestor-or-self::* [@isDoc and @level <= 3 and ( (self::AlmindeligTekstSide) or (self::TextPage))]" /> <div> <ul class="level1"> <xsl:for-each select="$rootTextpageNode/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id"> <xsl:attribute name="class"> <xsl:text>select</xsl:text> </xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(current()/@id)}"> <xsl:if test="@level > 3"> <xsl:attribute name="class"> <xsl:text>level2</xsl:text> </xsl:attribute> </xsl:if> <xsl:value-of select="current()/@nodeName"/> </a> </li> </xsl:for-each> </ul> </div> </xsl:template></xsl:stylesheet>
I would be grateful if you would look through the code and give feedback. thanks
I have an ekstra question to the menu. If there is no submenu I would like there to be inserted an image instead of the <ul>. How do I do that?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Submenu problem - more than 1 level
Hi
I have a submenu that works fine with 2 levels but I'm not sure it's the right way to do it. Here is my code:
<?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:template match="/">
<xsl:variable name="level" select="2"/>
<xsl:variable name="rootTextpageNode" select="$currentPage/ancestor-or-self::*
[@isDoc and @level <= 3 and (
(self::AlmindeligTekstSide) or (self::TextPage))]" />
<div>
<ul class="level1">
<xsl:for-each select="$rootTextpageNode/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
<xsl:attribute name="class">
<xsl:text>select</xsl:text>
</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(current()/@id)}">
<xsl:if test="@level > 3">
<xsl:attribute name="class">
<xsl:text>level2</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="current()/@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
</xsl:stylesheet>
I would be grateful if you would look through the code and give feedback. thanks
I have an ekstra question to the menu.
If there is no submenu I would like there to be inserted an image instead of the <ul>. How do I do that?
is working on a reply...