mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Update multiple option field's template
This commit is contained in:
parent
e4b1ddbd86
commit
952b9eafb0
@ -15,7 +15,7 @@ class EditableCheckboxGroupField extends EditableMultipleOptionField {
|
||||
|
||||
public function getFormField() {
|
||||
$field = new UserFormsCheckboxSetField($this->Name, $this->EscapedTitle, $this->getOptionsMap());
|
||||
$field->setTemplate('forms/UserFormsCheckboxSetField');
|
||||
$field->setFieldHolderTemplate('UserFormsMultipleOptionField_holder');
|
||||
|
||||
// Set the default checked items
|
||||
$defaultCheckedItems = $this->getDefaultOptions();
|
||||
|
@ -26,6 +26,7 @@ class EditableRadioField extends EditableMultipleOptionField {
|
||||
|
||||
public function getFormField() {
|
||||
$field = OptionsetField::create($this->Name, $this->EscapedTitle, $this->getOptionsMap());
|
||||
$field->setFieldHolderTemplate('UserFormsMultipleOptionField_holder');
|
||||
|
||||
// Set default item
|
||||
$defaultOption = $this->getDefaultOptions()->first();
|
||||
|
17
templates/UserFormsMultipleOptionField_holder.ss
Normal file
17
templates/UserFormsMultipleOptionField_holder.ss
Normal file
@ -0,0 +1,17 @@
|
||||
<fieldset id="$Name" class="field<% if $extraClass %> $extraClass<% end_if %>">
|
||||
<% if $Title %><legend class="left">$Title</legend><% end_if %>
|
||||
|
||||
<div class="middleColumn">
|
||||
$Field
|
||||
</div>
|
||||
|
||||
<% if $RightTitle %>
|
||||
<aside class="right" role="complementary">
|
||||
<p>$RightTitle</p>
|
||||
</aside>
|
||||
<% end_if %>
|
||||
|
||||
<% if $Message %><span class="message $MessageType">$Message</span><% end_if %>
|
||||
|
||||
<% if $Description %><span class="description">$Description</span><% end_if %>
|
||||
</fieldset>
|
Loading…
Reference in New Issue
Block a user