Versions Compared

Key

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

...

Info

This form definition is part of the Magnolia 6 UI framework. The fully qualified class name is info.magnolia.ui.editor.FormDefinition.

If you work with the Magnolia 5 UI framework, see Form definition for Magnolia 5 UI instead.

Table of Contents

Example

...

definition

Code Block
languageyml
form:
  properties:
    salutation:
      label: Salutation
      $type: textField
      i18n: true
    firstName:
      label: First name
      $type: textField
      required: true
    lastName:
      label: Last name
      $type: textField
      required: true
    email:
      label: Email
      $type: textField
      required: true
      validators:
        email:
          $type: emailValidator
    phone:
      label: Phone
      $type: textField
      required: true

...

Form properties

properties

required

A list List of editor property definition items (typically, a list of fields).

See Field definition for more information.

layout

optional, default is info.magnolia.ui.framework.layout.FormLayoutDefinition

Defines the form layout. The value must be a subtype of info.magnolia.ui.framework.layout.LayoutDefinition.

See Layout types for more information.

...

Code Block
languageyml
titleExample horizontal layout definition
collapsetrue
layout:
  $type: horizontal
  fields:
    - name: salutation
      label$type: SalutationtextField
      $typelabel: textFieldSalutation
    - name: firstName
      $type: textField
      label: First name
    - name: lastName
      $type: textField
      label: Last name

...

Code Block
languageyml
titleExample stacked layout definition
collapsetrue
layout:
  $type: stacked
  fields:
    - name: salutation
      label$type: SalutationtextField
      $typelabel: textFieldSalutation
    - name: firstName
      $type: textField
      label: First name
    - name: lastName
      $type: textField
      label: Last name

...