Details
-
Improvement
-
Resolution: Won't Do
-
Neutral
-
None
-
None
-
None
-
None
Description
Situation:
- I tried to use the Switchable field from:
https://documentation.magnolia-cms.com/display/DOCS62/Switchable+field - Started adaption the field with real use cases/fields
Problem:
- Example code of the docu uses only foo and bar everywhere:
switchable:
$type: switchableField
field:
$type: radioButtonGroupField
datasource:
$type: optionListDatasource
options:
- name: foo
value: foo
- name: bar
value: bar
itemProvider:
$type: jcrChildNodeProvider
forms:
- name: foo
properties:
foo:
$type: textField
- name: bar
properties:
bar:
$type: richTextField
- When adding real fields I stumbled over what in the 'options' references what in the 'forms'. Took me some time to figure it out.
- It is not intuitive! My first guesses were all wrong!
This code works/is the solution:
switchable: $type: switchableField label: Test Switchable field: $type: radioButtonGroupField datasource: $type: optionListDatasource options: - name: whatever1 value: foo label: Foo - name: whatever2 value: bar label: Bar itemProvider: $type: jcrChildNodeProvider forms: - name: foo properties: whatever3: $type: textField label: Foo - name: bar properties: whatever4: $type: richTextField label: Bar
- see the : whatever1-4 -> they are all ignored/not relevant!
- So what references what:
-
- the form's name references the options value!
Checklists
Acceptance criteria