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

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


Go to End


2 Posts   1393 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.