all things Sitecore related

XSL

XSL: for-each with max items

By on August 5, 2009 in XSL with 3 Comments

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:for-each select="*">     <xsl:if test="position()&lt;='9'">       <li>  <a href="{@link}">    <xsl:value-of select="@name"/>   </a>       </li>     </xsl:if>   </xsl:for-each> </ul>

Continue Reading »

Top