Model Definitions, Fields, and Component Types field-types
Learn about fields and the component types that the Universal Editor can edit in the properties rail with examples. Understand how you can instrument your own app by creating a model definition and linking to the component.
Overview overview
When adapting your own apps for use with the Universal Editor, you must instrument the components and define what fields and component types they can manipulate in the properties rail of the editor. You do this by creating a model and linking to that from the component.
This document provides an overview of a model definition and of fields and the component types available to you along with example configurations.
Model Definition Structure model-structure
In order to configure a component via the properties rail in the Universal Editor, a model definition has to exist and be linked to the component.
The model definition is a JSON structure, starting with an array of models.
[
{
"id": "model-id", // must be unique
"fields": [] // array of fields which shall be rendered in the properties rail
}
]
See the Fields section of this document for more information about how to define your fields
array.
To use the model definition with a component, the data-aue-model
attribute can be used.
<div data-aue-resource="urn:datasource:/content/path" data-aue-type="component" data-aue-model="model-id">Click me</div>
Loading a Model Definition loading-model
Once a model is created, it can be referenced as an external file.
<script type="application/vnd.adobe.aue.model+json" src="<url-of-model-definition>"></script>
Alternatively you can also define the model inline.
<script type="application/vnd.adobe.aue.model+json">
{ ... model definition ... }
</script>
Fields fields
A field object has the following type definition.
component
ComponentType
name
string
label
FieldLabel
description
FieldDescription
placeholder
string
value
FieldValue
valueType
ValueType
string
, string[]
, number
, date
, boolean
required
boolean
readOnly
boolean
hidden
boolean
multi
boolean
validation
ValidationType
raw
unknown
Component Types component-types
The following are the component types that are possible to use for rendering fields.
aem-tag
aem-content
boolean
checkbox-group
container
aem-content-fragment
date-time
multiselect
number
radio-group
reference
richtext
select
tab
text
AEM Tag aem-tag
An AEM tag component type enables an AEM tag picker, which can be used to attach tags to the component.
code language-json |
---|
|
![Screenshot of AEM tag component type](./media_1159651cabbe711ba93dd5acc430b04fcaa0a07c6.png?width=750&format=png&optimize=medium)
AEM Content aem-content
An AEM content component type type enables an AEM content picker, which can be used to set content references.
code language-json |
---|
|
![Screenshot of AEM content component type](./media_1f5cbfa1ff71d1a51b6c9e61d194b235760281617.png?width=750&format=png&optimize=medium)
Boolean boolean
A boolean component type stores a simple true/false value rendered as a toggle. It offers an additional validation type.
customErrorMsg
string
code language-json |
---|
|
code language-json |
---|
|
![Screenshot of boolean component type](./media_1b673ea5591e814bb10c8c2327a8d4345c8b6da50.png?width=750&format=png&optimize=medium)
Checkbox Group checkbox-group
Similar to a boolean, a checkbox group component type allows for the selection of multiple true/false items, rendered as multiple checkboxes.
code language-json |
---|
|
![Screenshot of checkbox group component type](./media_1a66c505c6ad3e5d45c1f493e5676ce69ebcca822.png?width=750&format=png&optimize=medium)
Container container
A container component type allows the grouping of components. It offers an additional configuration.
collapsible
boolean
code language-json |
---|
|
![Screenshot of container component type](./media_144a48a63fe8acb3d1ee1472b114c38b773fcdc4e.png?width=750&format=png&optimize=medium)
Content Fragment content-fragment
The Content Fragment picker can be used to select a Content Fragment and its variations (if required). It offers an additional configuration.
variationName
string
code language-json |
---|
|
![Screenshot of Content Fragment picker](./media_11756da76e36f9d7b47e87d06371a2f6c99371c54.png?width=750&format=png&optimize=medium)
Date Time date-time
A date time component type allows the specification of a date, time, or combination thereof. It offers additional configurations.
displayFormat
string
valueFormat
string
It also offers an additional validation type.
customErrorMsg
string
valueFormat
isn’t metcode language-json |
---|
|
code language-json |
---|
|
![Screenshot of date time component type](./media_1fb7ce59e7d55ecb8462d42e25b84056e31381cc5.png?width=750&format=png&optimize=medium)
Experience Fragment experience-fragment
The Experience Fragment picker can be used to select an Experience Fragment and its variations (if required). It offers an additional configuration.
variationName
string
code language-json |
---|
|
![Screenshot of Experience Fragment picker](./media_192e8f6521eb9ef084f0cd392393a4ce5dccc8dc6.png?width=750&format=png&optimize=medium)
Multiselect multiselect
A multiselect component type presents multiple items for selection in a drop-down including the ability to group the selectable elements.
code language-json |
---|
|
code language-json |
---|
|
![Screenshot of multiselect component type](./media_150cc6e56950fb2f7a83278ced464fba80c7ed9ac.png?width=750&format=png&optimize=medium)
![Screenshot of multiselect component type with grouping](./media_1dece1668ebedfa6b8c3956dc9d3277c4178c7488.png?width=750&format=png&optimize=medium)
Number number
A number component type allows for the input of a number. It offers additional validation types.
numberMin
number
numberMax
number
customErrorMsg
string
numberMin
or numberMax
isn’t metcode language-json |
---|
|
code language-json |
---|
|
![Screenshot of number component type](./media_15146425e109a386730d4a2edbf36bb159899e009.png?width=750&format=png&optimize=medium)
Radio Group radio-group
A radio group component type allows for a mutually-exclusive selection from multiple options rendered as a group similar to a checkbox group.
code language-json |
---|
|
![Screenshot of radio group component type](./media_19057aca4a834513c482f4f637c785b3b14c08419.png?width=750&format=png&optimize=medium)
Reference reference
A reference component type allows for a reference to another data object from the current object.
code language-json |
---|
|
![Screenshot of reference component type](./media_113db176eaad949caf55bc670dd51fe33b825464a.png?width=750&format=png&optimize=medium)
Rich Text rich-text
Rich text allows for multi-line, rich text input. It offers additional validation types.
maxSize
number
customErrorMsg
string
maxSize
is exceededcode language-json |
---|
|
code language-json |
---|
|
![Screenshot of text area component type](./media_12bd81eda29531805af2de8c81a45684f722c94a9.png?width=750&format=png&optimize=medium)
Select select
A select component type allows for selection of a single option from a list of predefined options in a drop-down menu.
code language-json |
---|
|
![Screenshot of select component type](./media_1c86213678ecd6ed6128f8ec37aab80bac74b7779.png?width=750&format=png&optimize=medium)
Tab tab
A tab component type allows you to group other input fields together on multiple tabs to improve layout organization for the authors.
A tab
definition can be thought of as a separator in the array of fields
. Everything that comes after a tab
will be placed on that tab until a new tab
is encountered, whereafter the following items will be placed on the new tab.
If you wish to have items that appear above all tabs, they must be defined before any tabs.
code language-json |
---|
|
![Screenshot of tab component type](./media_132123718b8b23e0fcbd612a3bdf5cfaeb6e1b3dd.png?width=750&format=png&optimize=medium)
Text text
Text allows for a single line of text input. It includes additional validation types.
minLength
number
maxLength
number
regExp
string
customErrorMsg
string
minLength
, maxLength
, and/or regExp
is/are violatedcode language-json |
---|
|
code language-json |
---|
|
![Screenshot of text component type](./media_1983458e1a920be3f84923c8ae42d65f78b7df63e.png?width=750&format=png&optimize=medium)