Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers 2

up vote 1 down vote accepted

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

<xsl:if test="@Order = 1">     
<!-- your logic -->
</xsl:if>
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 -->
</xsl:if> 
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

 
discard

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.