silverstripe-framework/templates/forms/CompositeField_holder.ss
Alex Saelens ed3c0b8d4e
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:46:31 +12:00

18 lines
449 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">
$FieldHolder
</div>
<% else %>
$FieldHolder
<% end_if %>
<% end_loop %>
<% if $Description %><span class="description">$Description</span><% end_if %>
</$Tag>