Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-6564

DOC: Fix description of how to configure SwitchableTransformer in M6

XMLWordPrintable

      On this page https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/Magnolia-6-UI-ports-of-5-UI-field-transformer-classes.html we miss an important configuration step for switchable fields, which caused SUPPORT-12592.

      composite.SwitchableTransformer Use info.magnolia.ui.editor.CurrentItemProvider and set propertyNameDecorator to info.magnolia.ui.field.PrefixNameDecorator.
      Set the name property for the field part of switcher configuration to match the switchable field's name.

       We also need to fix the example below: 

      form:
        properties:
          switchable:
            $type: switchableField
            field:
              name: switchable ## THIS PART WAS MISSING. Needs to be equivalent to M5 switchable's name.
              $type: radioButtonGroupField
              datasource:
                $type: optionListDatasource
                options:
                  - name: text
                    value: text
                  - name: richText
                    value: richText
            itemProvider:
              $type: currentItemProvider
            propertyNameDecorator: info.magnolia.ui.field.PrefixNameDecorator
            forms:
              - name: text
                properties:
                  text:
                    $type: textField
              - name: richText
                properties:
                  richText:
                    $type: richTextField
      

        Acceptance criteria

              akhamis Ashraf Khamis
              sdemocko Šimon Demočko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoR