Multifield component allows to add/reorder/remove multiple instances of a field. In the simplest case this is a simple form input field (e.g. textfield, textarea) but it can also be a complex component acting as an aggregate of multiple subcomponents (e.g. address entry).

The field to be included is defined in the subnode named field. Regardless of the component used, Multifield assumes they all write to the same property (defined by the name property of the field subnode) thus the resulting value will always be multi value.

When rendering existing entries, the Multifield will iterate over the multi value, get each value, set it in the field and let the field render it.

For example if the field is a text field with a name value of “fruits”, and you use Multifield to add three text fields and set them with values “apple”, “orange” and “banana”, the content node will get the following property after saving:

fruits: ["apple", "orange", "banana"]

If the field is a composite, it is its responsibility to concatenate the fields into one, before the form gets submitted, and to separate them again on rendering.

It extends Field component.

It has the following content structure:

  1. granite:FormField

The id attribute.


The class attribute. This is used to indicate the semantic relationship of the component similar to rel attribute.


The class attribute.


The title attribute.


Indicates if the field is mandatory to be filled.


The name of the validator to be applied. E.g. See validation in Granite UI.

  1. true

true to generate the SlingPostServlet @Delete hidden input based on the field name.


The value of SlingPostServlet @TypeHint.


The actual field of the Multifield.


+ myinput
  - sling:resourceType = "granite/ui/components/foundation/form/multifield"
  + field
    - sling:resourceType = "granite/ui/components/foundation/form/textfield"
    - name = "./pages"