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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

<% control %> Iterations


Go to End


3 Posts   2022 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 =)