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   1339 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
Pigeon

Community Member, 243 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 =)