silverstripe / silverstripe-elemental

Create pages in Silverstripe CMS using content blocks
http://dna.co.nz
BSD 3-Clause "New" or "Revised" License
109 stars 115 forks source link

Support `$startIndex` param on `Pos` method #1221

Open nedmas opened 1 month ago

nedmas commented 1 month ago

Description

The Pos method used in SilverStripe template loops supports adjusting the starting number of the position index (see silverstripe-framework/src/View/SSViewer_BasicIteratorSupport.php). It would be good to add feature parity for those wishing to use zero based indexes ;)

Additional context or points of discussion

No response

Validations

PRs

GuySartorelli commented 1 month ago

Hiya. As mentioned in your original PR, this can only be done in a major release. Feel free to open a new pull request targeting the 6 branch.