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

Best way to sort displayed dataobjects into 2 columns in the front end?


Go to End


2 Posts   1210 Views

Avatar
Erin

Community Member, 26 Posts

1 June 2010 at 6:14am

Hi guys,
This is - I think - a really basic question, but I'm wondering if anyone can give me an idea what the best way might be to display dataobjects in 2 columns on the front end?

Avatar
Willr

Forum Moderator, 5523 Posts

1 June 2010 at 5:00pm

You can use the $EvenOdd control and float the odds left and the evens right. For example class="<% if EvenOdd = odd %>left<% else %>right<% end_if %>. This will give you the appearance of 2 columns.