Im not sure where this module/addon came from, but I used it with SS 2.4 and now with upgrading to SS 3.1 I am unable to get it to work.
I was hoping someone was able to take a look at it for me.
EditableCompositeField.php
<?php
class EditableCompositeField extends EditableFormField {
static $singular_name = 'Container Field';
static $plural_name = 'Containers';
static $has_many = array(
"SubFields" => "EditableFormField"
);
function getFormField() {
$children = $this->SubFields();
$field = new CompositeField();
if($children && $children->exists()) {
foreach($children as $child) {
$field->push($child->getFormField());
}
}
return $field;
}
public function IsContainer(){return true;}
}
There also seems to be some modifications within CSS
FieldEditor.css
/** Container Fields **/
#Fields_fields .EditableCompositeField ul.subFieldsList {
min-height: 20px;
padding-bottom: 10px;
background: #f4f4f4;
display: block;
clear: both;
margin-left: 38px;
}
#Fields_fields .EditableCompositeField ul.subFieldsList li {
display: block;
margin: 0 2px 0 7px;
padding-left: 10px;
background: white;
}
and addition to EditableFormField.ss
<% if IsContainer %>
<ul class="subFieldsList ContainerField{$ID}">
<% if SubFields %>
<% control SubFields %>
$EditSegment
<% end_control %>
<% end_if %>
</ul>
<% end_if %>
Is it possible to create a container field within SS3.1?
I seem to be missing something, adding these additions into the SS 3.1 userforms module and fixing depreciation didnt seem to work too well.
I was unable to drag onto the container field.