I am using SharePoint 2013 and building display templates. I have now a control and item display template. In the control display template I can get the index of each item:


But how can I do this in the item display template?

1 Answer 1


The index can also be retrieved in the item display template the same way as the piece of code above:


In one of my blog posts is an example of how you could use it: Showing Alternating Rows in the Content Search WebPart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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