Preparations
- in the IDE:
- open /modules/in-bulletin/admin_templates/polls/poll_edit.tpl file for editing
- add <inp2:m_RenderElement name="inp_label" prefix="poll" field="MultiOptionField" format=", "/> line after <inp2:m_RenderElement name="subsection" title="la_section_General"/> line
- save changes
- open /modules/in-bulletin/units/polls/polls_config.php file for editing
- add this fragment in the $config array:
'VirtualFields' => array( 'MultiOptionField' => array( 'type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => array(1 => 'Option 1', 3 => 'Option 3'), 'multiple' => 1, 'default' => '|1|2|3|', ), ),
- save changes
Testing
- in Admin Console
- login to the Admin Console
- go to Website & Content → Polls section
- press Add button on the toolbar
- confirm, that newly added field has Option 1, Option 3, 2 value
- press Cancel button on the toolbar
- in IDE:
- open /modules/in-bulletin/units/polls/polls_config.php file for editing
- change default field option of MultiOptionField field to the |1|3|
- save changes
- in Admin Console
- login to the Admin Console
- go to Website & Content → Polls section
- press Add button on the toolbar
- confirm, that newly added field has Option 1, Option 3 value
- press Cancel button on the toolbar