Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

<% control %> Iterations


Go to End


3 Posts   1739 Views

Avatar
Tonyair

Community Member, 81 Posts

10 June 2010 at 9:19am

How to count <% control %> iterations?
For example, if u want to display Staff Articles in the table form.

Avatar
dhensby

Community Member, 253 Posts

10 June 2010 at 11:53am

Edited: 10/06/2010 11:56am

$Pos in a control will tell you what iteration you are in. ie: $Pos == 1 for the first, $Pos == 2 for the second and so on.

This might help you: http://doc.silverstripe.org/built-in-page-controls#quick_reference

Avatar
Tonyair

Community Member, 81 Posts

10 June 2010 at 4:57pm

Thx =)