Versions Compared

Key

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

...

properties

required

A 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

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

See Form layout Layout types for more information.

Available field definition classes

Include Page
_Field definition classes
_Field definition classes

...

Layout types

$type

class

declarativeLayout

info.magnolia.ui.framework.layout.DeclarativeLayoutDefinition

form

info.magnolia.ui.framework.layout.FormLayoutDefinition

horizontal

info.magnolia.ui.framework.layout.HorizontalLayoutDefinition

tabbedLayout

info.magnolia.ui.framework.layout.TabbedLayoutDefinition

Default layout

With the default layout, it is not possible to configure anything. Use this layout class when there is no need for customization.Use 

Info

...

Info

Since Magnolia 6.2, FormLayoutDefinition has replaced the deprecated PlainFormLayoutDefinition as the default layout.

...

With the horizontal layout, you can enable spacing between fields in the layout.

Use info.magnolia.ui.framework.layout.HorizontalLayoutDefinition for the class property or horizontal for the $type shortcut.

Code Block
languageyml
titleExample horizontal layout definition
collapsetrue
composite:
  $type: compositeField
  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

...

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

Use info.magnolia.ui.framework.layout.TabbedLayoutDefinition for the class property or tabbedLayout for the $type shortcut.

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

...

With the declarative layout, you can create form entries in an arbitrary Vaadin component container using the Vaadin declarative syntax. Use this layout class for full customization.Use info.magnolia.ui.framework.layout.DeclarativeLayoutDefinition for the class property or declarativeLayout for the $type shortcut.

Code Block
languageyml
titleExample declarative layout definition
collapsetrue
layout:
  $type: declarativeLayout
  template: /contacts/layouts/edit-contact.html

...