Okay I am struggling with XSTL :(
http://www.catsanddogs.co.nz/dogs.aspx - I have this menu which works fine, but if i click on a 3rd level menu then I want it to expand into the main menu also, only works for second level menus at the moment..becuase a UL tag has been created. If anyone could help me with this it would be much appreciated.
Code:
<?xml version="1.0" encoding="utf-8"?>
<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:variable name="currentID" select="$currentPage/self::node/@id"/>
<xsl:output method="html"/>
<xsl:param name="currentPage"/>
<xsl:variable name="maxLevelForSitemap" select="6"/>
<xsl:template match="/">
<ul class="menulist" id="listMenuRoot">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=1 and string(data [@alias='umbracoNaviHide']) != '1'] "/>
</xsl:call-template>
</ul>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<xsl:for-each select="$parent/node [string(data [@alias='umbracoNaviHide']) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:if test="current()/@id = $currentID">
<xsl:attribute name="style">background-color: green;</xsl:attribute>
</xsl:if>
<xsl:if test="current()/parent::node/@id = $currentID">
<xsl:attribute name="style">background-color: #a13d55;</xsl:attribute>
</xsl:if>
<xsl:value-of select="@nodeName"/>
</a>
<xsl:if test="count(node[string(./data [@alias='umbracoNaviHide']) != '1' ]) > 0">
<xsl:if test="current()/@id != $currentID">
<ul>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</ul>
</xsl:if>
</xsl:if>
</li>
<xsl:if test="current()/@id = $currentID">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
New Zealand Umbracoee