While working with Umbraco and Sitecore I learned some Xsl tricks.
The following example shows how to show the first 10 items in a HTML list.
<ul> <xsl:if test="position() <li> <a href="{@link}"> </a> </li> </ul>
While working with Umbraco and Sitecore I learned some Xsl tricks.
The following example shows how to show the first 10 items in a HTML list.
<ul> <xsl:if test="position() <li> <a href="{@link}"> </a> </li> </ul>
In this case (when your just limiting results) it’s probably better to put the position into the for each statement. Something like:
<xsl:for-each select="position()<=’9’">
using it in the <if> statement is great for displaying a couple of items differently (for example the first 3)
correction:
<xsl:for-each select="item[position()<=’2′]">
Hey thanks for this post. It helped me out of a jam today. Any chance you can help with how to do greater than/less than using the above example?