Is it possible to add a class to alternating list items when using the DDR Superfish template? My designer gave me the following:
The one thing that I am having issues implementing is the 2 alternating shades of yellow and then the alternating gray and white in the submenu. I have customized my XLST file a bit already. Can someone take a peek below and offer any suggestions?
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
xsl:output
method
=
"html"
/>
<
xsl:param
name
=
"ControlID"
/>
<
xsl:param
name
=
"Options"
/>
<
xsl:template
match
=
"/*"
>
<
xsl:apply-templates
select
=
"root"
/>
</
xsl:template
>
<
xsl:template
match
=
"root"
>
<
script
type
=
"text/javascript"
>
jQuery(function($) {
$("#<
xsl:value-of
select
=
"$ControlID"
/>").superfish(
<
xsl:value-of
select
=
"$Options"
/>
);
});
</
script
>
<
ul
class
=
"sf-menu level1"
id
=
"{$ControlID}"
>
<
xsl:apply-templates
select
=
"node"
/>
</
ul
>
</
xsl:template
>
<
xsl:template
match
=
"node"
>
<
li
>
<
xsl:attribute
name
=
"class"
>
<
xsl:if
test
=
"@first = 1"
>first</
xsl:if
>
<
xsl:if
test
=
"@last = 1"
>
<
xsl:text
> </
xsl:text
>last
</
xsl:if
>
<
xsl:if
test
=
"@selected = 1"
>
<
xsl:text
> </
xsl:text
>selected
</
xsl:if
>
</
xsl:attribute
>
<
span
>
<
a
>
<
xsl:choose
>
<
xsl:when
test
=
"@enabled = 1"
>
<
xsl:attribute
name
=
"href"
>
<
xsl:value-of
select
=
"@url"
/>
</
xsl:attribute
>
</
xsl:when
>
<
xsl:otherwise
>
<
xsl:attribute
name
=
"href"
>#</
xsl:attribute
>
<
xsl:attribute
name
=
"onclick"
>return false</
xsl:attribute
>
</
xsl:otherwise
>
</
xsl:choose
>
<
xsl:value-of
select
=
"@text"
/>
</
a
>
</
span
>
<
xsl:if
test
=
"node"
>
<
ul
class
=
"level{@depth + 2}"
>
<
xsl:apply-templates
select
=
"node"
/>
</
ul
>
</
xsl:if
>
</
li
>
</
xsl:template
>
</
xsl:stylesheet
>