You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

DEPRECATED

This field definition has been deprecated since Magnolia 6.0. It is part of the Magnolia 5 UI framework.

For the updated implementation, see Field definition for Magnolia 6 UI instead.

A field is an HTML form element that allows a user to perform a task such as enter text, upload an image or select a date. Magnolia ships with a number of fields that should fulfill most needs.

Example

This form has four text fields and one checkbox field:

To add a field on your form, define the field inside a tab (see example below). At minimum, a field definition must contain a class or a fieldType property which tells Magnolia what type of field it should render. Set the property value to a valid field definition class name (for class) or to a valid field alias name (for fieldType). All fields support further common properties for defining things such as labels and descriptions.

<module name>/dialogs/<dialog name>.yaml
form:
  tabs:
    - name: tabMain
      label: Text
      fields:
        - name: title
          fieldType: text
          label: pages.pageProperties.title.label
          description: pages.pageProperties.title.description 
          i18n: true
          required: true
          type: string
Node nameValue

 
form


 
tabs


 
tabMain


 
fields


 
title       


 
fieldType

text

 
description

pages.pageProperties.title.description

 
i18n

true

 
label

pages.pageProperties.title.label

 
required

true

 
type

String

See the complete form definition in Git.

Common field properties

You can use these properties with any field unless specified otherwise.

Unable to render {include} The included page could not be found.

Field types

$typeclass
checkBoxFieldinfo.magnolia.ui.field.CheckBoxFieldDefinition
checkBoxGroupFieldinfo.magnolia.ui.field.CheckBoxGroupFieldDefinition
codeFieldinfo.magnolia.ui.field.CodeFieldDefinition

comboBoxField

jsonComboBoxField

info.magnolia.ui.field.ComboBoxFieldDefinition

info.magnolia.rest.ui.field.comboboxfield.JsonComboBoxFieldDefinition

compositeField

jsonCompositeField

info.magnolia.ui.field.CompositeFieldDefinition

info.magnolia.rest.ui.field.JsonCompositeFieldDefinition

dateFieldinfo.magnolia.ui.field.DateFieldDefinition
hiddenFieldinfo.magnolia.ui.field.HiddenFieldDefinition

linkField

damLinkField

pageLinkField

jsonLinkField

info.magnolia.ui.field.LinkFieldDefinition

info.magnolia.dam.app.field.DamLinkFieldDefinition

info.magnolia.pages.app.field.PageLinkFieldDefinition

info.magnolia.rest.ui.field.linkfield.JsonLinkFieldDefinition

listSelectFieldinfo.magnolia.ui.field.ListSelectFieldDefinition

multiField

jcrMultiValueField

jcrMultiField

jsonMultiField

info.magnolia.ui.field.MultiFieldDefinition

info.magnolia.ui.field.JcrMultiValueFieldDefinition

info.magnolia.ui.field.JcrMultiFieldDefinition

info.magnolia.rest.ui.field.JsonMultiFieldDefinition

passwordFieldinfo.magnolia.ui.field.PasswordFieldDefinition
radioButtonGroupFieldinfo.magnolia.ui.field.RadioButtonGroupFieldDefinition
richTextFieldinfo.magnolia.ui.field.RichTextFieldDefinition
sliderFieldinfo.magnolia.ui.field.SliderFieldDefinition
staticFieldinfo.magnolia.ui.field.StaticFieldViewDefinition
switchableFieldinfo.magnolia.ui.field.SwitchableFieldDefinition
textFieldinfo.magnolia.ui.field.TextFieldDefinition
tokenFieldinfo.magnolia.ui.field.TokenFieldDefinition
twinColSelectFieldinfo.magnolia.ui.field.TwinColSelectFieldDefinition

Your Magnolia installation may contain more fields depending on the installed modules.

Transformer classes

Unable to render {include} The included page could not be found.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels