SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In one of my itemstyles I want the first element in the list to have a bit different look than the other items being displayed. How is it possible to take the first item?

share|improve this question
up vote 1 down vote accepted

Try following because *Main.xsl passes @order parameter to ItemStyle.xsl:

<xsl:if test="@Order = 1">     
<!-- your logic -->
share|improve this answer

This isn't really a SharePoint question but I think the answer you are looking for is something like this:

<xsl:if test="position() = 1">
    <!-- do your custom formatting logic -->
share|improve this answer
Dave, that does not work because item style is template caused one by one and condition will be always true. – Ashish Patel Dec 21 '11 at 16:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.