Hi all!
I have something of a basic question. It seems I was even more out of practice than I thought when I took on this job ...
The XSLT below generates a menu in the form of an Unordered List. I've managed to make it appear where I want it, but I also need to assign a different .CLASS to each LIst item (1 to 8). Can someone help?
I'd also like to me rid of the submenu here ... I've managed it temporarily by using "display: none" in the CSS, but that's hardly the way to do it!
I hope someone can help me out -- I'd be ever so greatful
I have something of a basic question. It seems I was even more out of practice than I thought when I took on this job ...
The XSLT below generates a menu in the form of an Unordered List. I've managed to make it appear where I want it, but I also need to assign a different .CLASS to each LIst item (1 to 8). Can someone help?
Code:
<xsl:template name="MENU">
<!-- Applies the horisontal menu -->
<div id="horimeny">
<div id="meny">
<ul>
<xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT = $INTERNETROOT]" mode="MAIN_MENU"/>
</ul>
</div><!-- END #meny -->
</div><!-- END #horimeny -->
</xsl:template>
<xsl:template match="FOLDERS/*" mode="MENU">
<xsl:variable name="url">
<xsl:choose>
<xsl:when test="starts-with(LABEL, '[URL unfurl="true"]http://')"><xsl:value-of[/URL] select="LABEL"/></xsl:when>
<xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"/>
<li>
<xsl:if test="contains($PATH, concat(',', ID, ','))">
<xsl:attribute name="class">
<xsl:text>current</xsl:text>
<xsl:if test="$pos = 0 or LABEL = 'home'"><xsl:text> first</xsl:text></xsl:if>
<xsl:if test="not(following-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"><xsl:text> last</xsl:text></xsl:if>
</xsl:attribute>
</xsl:if>
<!--<xsl:value-of select="$pos"/>-->
<a href="{$url}"><span><xsl:apply-templates select="NAME/text()"/></span></a>
</li>
I'd also like to me rid of the submenu here ... I've managed it temporarily by using "display: none" in the CSS, but that's hardly the way to do it!
I hope someone can help me out -- I'd be ever so greatful