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.

Template Questions

<% control %> Iterations


Reply

3 Posts   1334 Views

Avatar
Tonyair

10 June 2010 at 9:19am Community Member, 81 Posts

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

Avatar
Pigeon

10 June 2010 at 11:53am (Last edited: 10 June 2010 11:56am), Community Member, 243 Posts

$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

10 June 2010 at 4:57pm Community Member, 81 Posts

Thx =)