Reputation: 10561
Im using XSLT to build a list of select products. They are shown in rows of three. I want to add a class to the right most (third) box in each row to remove the right margin. Any ideas how I can do this? Im really new to XSLT.
Upvotes: 1
Views: 379
Reputation: 10561
Here is a solution I got from the Umbraco forum. Can't take credit for it, but I'm posting it for future reference.
<xsl:for-each select="$currentPage/child::* [@isDoc]">
<div class="something">
<xsl:if test="position() mod 3 = 0">
<xsl:attribute name="class">something someotherclass</xsl:attribute>
</xsl:if>
Content of div
</div>
</xsl:for-each>
Upvotes: 1