The 5.7 branch of Magnolia reached End-of-Life on December 31, 2023, as specified in our End-of-life policy. This means the 5.7 branch is no longer maintained or supported. Please upgrade to the latest Magnolia release. By upgrading, you will get the latest release of Magnolia featuring significant improvements to the author and developer experience. For a successful upgrade, please consult our Magnolia 6.2 documentation. If you need help, please contact info@magnolia-cms.com.
The collapsible composite field is provided by the Content Editor module which is an EE Pro module.
CollapsibleCompositeFieldDefinition extends the composite field to add a clickable header that toggles the visibility of the field's content. Editors can click the header to display and hide the subfields.
Like the composite field, the collapsible composite field defines a complex field that is composed of multiple simple fields.
The class: info.magnolia.editor.app.field.CollapsibleCompositeFieldDefinition
The fieldType: collapsibleComposite
The collapsible composite field is useful in content editor apps like the Stories app as shown below.
Collapsed:
Expanded:
It can also be used in a standard dialog as well. Here is a collapsible composite field that consists of a text field and a date field:
Collapsible composite field properties
Simple collapsible composite field definition:
form: tabs: - name: tabExample fields: - name: event fieldType: collapsibleComposite label: Event fields: - name: title fieldType: text label: Title - name: date fieldType: date label: Date
Node name | Value |
---|---|
form | |
tabs | |
tabExample | |
fields | |
event | |
fields | |
title | |
fieldType | text |
label | Title |
date | |
fieldType | date |
label | Date |
fieldType | collapsibleComposite |
label | Event |
You can use common field properties and the following properties in a collapsible composite field definition:
Composite field properties.
<collapsible composite field name> | required Name of parent composite field. |
| required Node containing child fields. |
| required Name of the child fields. You can use any simple field definition. |
| required Field definition class of the child field. |
| required/optional Any properties the child field supports. |
Properties specific to the collapsible composite field.
| required Definition class of the composite parent field. Use |
| optional, default is Defines whether the field should be collapsed initially. |
| optional, default is Custom property transformer definition. |
| optional, default is Defines the layout of the child fields: In custom content editor apps, this property must remain set to |
Best practice
When nesting composite fields, use the delegating transformer classes, DelegatingCompositeFieldTransformer or DelegatingMultiValueFieldTransformer, rather than the other available transformer classes.