Hi guys
I am a newbie and have trouble with displaying my dropdown menus. This is my site structure
content
- Home
--- term 1
----- session 1
--- term 2
----- session 2
I want display submenus in term 1 and term 2.
The following is my code
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="/">
<!-- start writing XSLT -->
<ul id="Navi">
<xsl:for-each select="$currentPage/ancestor::root/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">Selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=1]/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
<xsl:attribute name="class">Selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
<ul>
<xsl:for-each select="./descendant::node [@level=3]/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/node/@id = current()/@id">
<xsl:attribute name="class">Selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}"><xsl:attribute name="title"><xsl:value-of select="@nodeName" /> </xsl:attribute><xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Please help me out here.