What code to use for submenu in the .xsl file?
Posted: Sun Apr 19, 2015 5:18 pm
Hello, i have this code now for a menu whitout any dropdown. How should the code look like for a menu with submenus?
And the HTML code for the menu looks like this:
Thank you.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match='/'>
<ul>
<xsl:for-each select="DATASET/ITEM">
<li><a href="{URL}"><xsl:value-of disable-output-escaping="yes" select="MENUNAME"/></a></li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<div class="nav">
<div class="rmm">
<ul>
<li><a class="active_yes" href="#">HOME</a></li>
<li>
<a href="#">BOOKS</a>
<ul>
<li>
<a href="#">AUDIOBOOKS</a>
</li>
<li>
<a href="#">COOKBOOKS</a>
</li>
<li>
<a href="#">CATALOGS</a>
</li>
<li>
<a href="#">OTHER</a>
</li>
</ul>
</li>
<li>
<a href="#">DVDS</a>
</li>
<li>
<a href="#">MUSIC</a>
<ul>
<li><a href="#">CASSETTES</a></li>
<li><a href="#">CD</a></li>
<li><a href="#">RECORDS</a></li>
</ul>
</li>
<li>
<a href="#">VIDEO GAMES</a>
</li>
</ul>
</div>
</div>