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

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use:

<perch:content id="perch_item_zero_index" />

I love you!