Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(info) From Magnolia 6.2.1, FormLayoutDefinition has replaced the deprecated PlainFormLayoutDefinition as the default layout.

Code Block
languageyml
titleExample editor action layout definition
collapsetrue
footerLayout:
  $type: defaultEditorActionLayout
  primaryActions:
    - choose
    - cancel
  secondaryActions:
    - above
    - below

Tabbed layout

With the tabbed layout, you can arrange fields in tabs. It is not possible to change how any tabs and fields are rendered.

Code Block
languageyml
titleExample tabbed layout definition
collapsetrue
layout:
  $type: tabbedLayout
  tabs:
    personal:
      fields:
        - name: salutation
        - name: firstName
        - name: lastName
    details:
      fields:
        - name: email
        - name: phone
    address:
      fields:
        - name: streetAddress
        - name: postalCode
        - name: city
        - name: country

...

Horizontal layout

With the stacked horizontal layout, you can arrange components vertically. This is the default layout for composite fieldshorizontally. To disable spacing between components, set the spacing property to false.

Code Block
languageyml
titleExample stacked horizontal layout definition
collapsetrue
composite:
  $type: compositeField
  label: Name
  layout: stacked
  fields:
    - name: salutation
      label: Salutation
      $type: select
      optionshorizontal
properties:
        - name: Mr.
          value: Mr.
          label: Mr.
        - name: Mrs.
          value: Mrs.
          label: Mrs.
    - name: firstName
      $type: text
      label: First name
    - name: lastName
      $type: text
      label: Last name

Horizontal layout

multi:
    $type: jcrMultiField

Stacked layout

With the stacked With the horizontal layout, you can arrange components horizontally. To disable spacing between components, set the spacing property to falsevertically. Any captions are placed above the respective components, which means that more horizontal space is allocated to the components themselves. This is the default layout for composite fields.

Code Block
languageyml
titleExample horizontal stacked layout definition
collapsetrue
compositelayout:
  $type: compositeFieldstacked
  label: Name
  layout: horizontal
  fields:
    - name: salutation
      label: Salutation
      $type: select
      options:
        - name: Mr.
          value: Mr.
          label: Mr.
        - name: Mrs.
          value: Mrs.
          label: Mrs.
    - name: firstName
      $type: text
      label: First name
    - name: lastName
      $type: text
      label: Last name

...

Code Block
languageyml
titleExample editor action layout definition
collapsetrue
form:
  properties:
    text:
      label: Text
      $type: textField
      light: true
footerLayout:
  $type: defaultEditorActionLayout
  primaryActions:
    commit: commit