We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Count function

Is there anyway of counting up from 0 in a Perch template in a loop? I can do it from 1 or an ID number but Bootstrap's default carousel (and perhaps other JS-powered slideshows?) uses a "from zero counting method" to list its navigation buttons. It would be great if there was a customisable count tag for things like this? Something like <perch:count from="0" /> would be awesome :) !

ps Has anyone else solved this with javascript?

Many thanks in advance.

Jon

Jonathan Elliman

Jonathan Elliman 27 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use:

<perch:content id="perch_item_zero_index" />

I love you!