silverstripe-framework/templates/forms/CompositeField_holder_small.ss
Alex Saelens fd7efba7d9
Make column work
The ColumnCount is set on the CompositeField class, and not on its FieldList. So to get the ColumnCount, we need to use $Top to get out of the loop.
2018-07-04 09:48:39 +12:00

16 lines
377 B
Scheme

<$Tag class="CompositeField $extraClass <% if ColumnCount %>multicolumn<% end_if %>">
<% if $Tag == 'fieldset' && $Legend %>
<legend>$Legend</legend>
<% end_if %>
<% loop FieldList %>
<% if $Top.ColumnCount %>
<div class="column-{$Top.ColumnCount} $FirstLast">
$SmallFieldHolder
</div>
<% else %>
$SmallFieldHolder
<% end_if %>
<% end_loop %>
</$Tag>