2

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:

inCtx.CurrentItemIdx

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

2

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

ctx.CurrentItemIdx

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, privacy policy and cookie policy

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