The form definition defines the tabs and fields in a dialog.

Form properties

Simple form definition with two tabs and Title ( plain text ), Text ( rich text ) and a link field to link to an asset from dam.

<my-module>/dialogs/components/<dialog name>.yaml
form:
  tabs:
    - name: tabText
      label: Text
      fields:
        - name: title
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          label: Title
        - name: textEditor
          class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
          label: Text editor
    - name: tabImage
      label: Image
      fields:
        - name: image
          class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
          targetWorkspace: dam
          appName: assets
          identifierToPathConverter:
            class: info.magnolia.dam.app.assets.field.translator.AssetCompositeIdKeyTranslator
          contentPreviewDefinition:
            contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent
Node nameValue

 
<dialog name>


 
actions


 
form


 
tabs


 
tabText


 
fields


 
title


 
class

info.magnolia.ui.form.field.definition.TextFieldDefinition

 
label

Title

 
textEditor


 
class

info.magnolia.ui.form.field.definition.RichTextFieldDefinition

 
label

Text editor

 
label

Text

 
tabImage


 
fields


 
image


 
class

info.magnolia.ui.form.field.definition.LinkFieldDefinition

 
targetWorkspace

dam

 
appName

assets

 
identifierToPathConverter


 
class

info.magnolia.dam.app.assets.field.translator.AssetCompositeIdKeyTranslator

 
icontentPreviewDefinition


 
class

info.magnolia.dam.app.ui.field.DamFilePreviewComponent

 
label

Image

Nodes and properties:

<dialog name>

required

Arbitrary node name. Typically matches the template it edits. For example the component definition node and dialog definition node for a link component could both be named link. This is not required and one dialog can be used for more than one template.

form

required

Contains the form definition which defines the tabs and fields where content is entered.

tabs

required

Contains the tabs within the form. Every dialog needs at least one tab.

<tab name>

required

The name of the tab. Arbitrary node name. Use a name that describes the content of the tab like imageTab or addressTab.

fields

required

Contains the fields within the tab. See Field definition for more.

<field name>

required

Arbitrary field name. Use a name that describes the field like title or headline.

class

required

Field definition class. See Available field definition classes and List of fields for more.

<other field properties>

optional

See Common field properties for a list of optional properties that can be used with all fields.

required

Each field definition class supports its own properties. See List of fields for properties and example configurations of each field.

label

optional

The tab label. Displays in the tab.


Available field definition classes

  • info.magnolia.ui.form.field.definition.TextFieldDefinition
  • info.magnolia.ui.form.field.definition.RichTextFieldDefinition
  • info.magnolia.ui.form.field.definition.DateFieldDefinition
  • info.magnolia.ui.form.field.definition.HiddenFieldDefinition
  • info.magnolia.ui.form.field.definition.LinkFieldDefinition
  • info.magnolia.ui.form.field.definition.CodeFieldDefinition
  • info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
  • info.magnolia.ui.form.field.definition.PasswordFieldDefinition
  • info.magnolia.ui.form.field.definition.SelectFieldDefinition
  • info.magnolia.ui.form.field.definition.OptionGroupFieldDefinition
  • info.magnolia.ui.form.field.definition.TwinColSelectFieldDefinition
  • info.magnolia.ui.form.field.definition.CheckboxFieldDefinition
  • info.magnolia.ui.form.field.definition.CompositeFieldDefinition
  • info.magnolia.ui.form.field.definition.SwitchableFieldDefinition
  • info.magnolia.ui.form.field.definition.StaticFieldDefinition
  • info.magnolia.ui.form.field.definition.BasicUploadFieldDefinition
  • info.magnolia.dam.app.ui.field.definition.DamUploadFieldDefinition
  • info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
  • info.magnolia.editor.app.field.ExpandingTextFieldDefinition

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))