I have a layout whereby I need to layout 2 rows of content:
Something like this
div
col1
col2
col3
col4
/div
div
col5
col6
col7
col8
/div
Is there a way to do this with SS templating?
TIA
Dave
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
I have a layout whereby I need to layout 2 rows of content:
Something like this
div
col1
col2
col3
col4
/div
div
col5
col6
col7
col8
/div
Is there a way to do this with SS templating?
TIA
Dave
Either:
<div>
<% loop $Data.Limit(4,0) %>
$Name
<% end_loop %>
</div>
<div>
<% loop $Data.Limit(4,4) %>
$Name
<% end_loop %>
</div>
Or:
<div>
<% loop $Data %>
$Name
<% if $MultipleOf(4) %>
</div><div>
<% end_if %>
<% end_loop %>
</div>
Thanks Devlin, didnt notice it took an offset!