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.

Data Model Questions /

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

How to add a counter on a Control Loop??


Go to End


6 Posts   7120 Views

Avatar
b0bro

Community Member, 38 Posts

11 August 2009 at 12:24pm

How do i count a control loop?

Basically, i want to print some extra code every 3 times it goes through a loop.

eg

<% control LatestExhibtion %>

*** If this third time echo <br />

<% end_control %>

Avatar
Hamish

Community Member, 712 Posts

11 August 2009 at 6:21pm

cross post, see my answer on the other thread.

Avatar
teejay

Community Member, 63 Posts

15 February 2010 at 5:47pm

What other thread :)

Avatar
bummzack

Community Member, 904 Posts

15 February 2010 at 7:38pm

Avatar
Sean

Forum Moderator, 922 Posts

15 February 2010 at 8:54pm

SS 2.4 has <% if IsMultipleOf(3) %> which should help :)

Avatar
JRTotten

Community Member, 4 Posts

28 June 2012 at 7:48am

or $Pos if you're looking to assign a count to each item