Universal Editor Component Model Configuration
This skill helps you create or edit the three JSON configuration files that control how AEM Edge Delivery Services (EDS) blocks appear and behave in the Universal Editor (UE):
- component-definition.json — Registers blocks in the UE component palette
- component-models.json — Defines property panel fields for each block
- component-filters.json — Controls where blocks can be placed
When to Use
- Creating a new block that needs UE authoring support
- Adding/modifying fields on an existing block's property panel
- Registering a block so it appears in the author's component palette
- Setting up container blocks with child items
- Adding block variants/style options
Workflow
Step 1: Understand the Block
Before generating any configuration, read and analyze:
The block's JS file (blocks/<name>/<name>.js) — understand what content the decorate(block) function expects:
- What does it read from the block div? (images, links, text, classes)
- Does it expect a flat structure or rows of items?
- Does it use
block.querySelector('a') (links/URLs), block.querySelector('picture') (images), etc.?
- Does it check for CSS classes/variants?
The block's CSS file (blocks/<name>/<name>.css) — look for variant-specific styles.
Existing config — check if entries already exist:
- Search
component-definition.json for the block ID
- Search
component-models.json for the model ID
- Search
component-filters.json for the block in the section components list
- Check for a
blocks/<name>/_<name>.json distributed config file
Step 2: Determine the Block Type
Based on the JS analysis:
Simple block: One component with its own fields. Most blocks are this type.
- Example: Hero, Embed — single model, no children
Container block: Has repeatable child items (cards, slides, tabs).
- Clue: JS iterates over
block.children or creates items from rows
- Needs: container definition + item definition + filter
Key-value block: Configuration-style block (2-column key-value pairs).
- Clue: Each property is independent, not a grid of content
- Needs:
"key-value": true in template
Step 3: Design the Model Fields
Map the block's content expectations to component model fields. Read references/field-types.md for the full field type reference.
Common field mappings:
| Block expects... |
Use component type |
Notes |
| An image |
reference (name: image) |
Pair with text field named imageAlt |
| A URL/link |
aem-content (name: link or url) |
For page links and external URLs |
| Rich text content |
richtext |
For formatted text with headings, lists, links |
| Plain text (single line) |
text |
For titles, labels, short strings |
| Plain text (multi-line) |
textarea |
For descriptions, notes, long text without formatting |
| Heading level choice |
select with h1-h6 options |
Name it titleType to auto-collapse with title |
| Style variants |
multiselect (name: classes) |
Values become CSS classes on block div |
| Multiple toggles |
checkbox-group |
For multiple independent boolean options |
| Boolean toggle |
boolean |
For show/hide options |
| Number value |
number |
For counts, limits |
| Content Fragment |
aem-content-fragment |
For CF-driven blocks |
| Experience Fragment |
aem-experience-fragment |
For reusable content+layout fragments |
| Content tags |
aem-tag |
For categorization via AEM tag picker |
Field naming rules (semantic collapsing):
image + imageAlt → collapsed into <picture><img alt="...">
link + linkText + linkTitle + linkType → collapsed into <a href="..." title="...">text</a> with optional class
title + titleType → collapsed into <h2>title</h2> (level from titleType)
- Fields prefixed with
group_ (underscore separator) are grouped into a single cell
Step 4: Generate the Configuration
Generate entries for all three files. The approach depends on whether the project uses centralized or distributed config.
Check for distributed config pattern: If the block directory contains _<blockname>.json files (e.g., blocks/hero/_hero.json), create a distributed config file instead of editing the central files.
For Centralized Config (editing the three root JSON files):
component-definition.json — Add to the "Blocks" group's components array:
{
"title": "<Block Display Name>",
"id": "<block-id>",
"plugins": {
"xwalk": {
"page": {
"resourceType": "core/franklin/components/block/v1/block",
"template": {
"name": "<Block Name>",
"model": "<model-id>"
}
}
}
}
}
For container blocks, add both the container AND item definitions. The container gets "filter" instead of "model", and the item uses "core/franklin/components/block/v1/block/item" as resourceType.
For key-value blocks, add "key-value": true to the template.
Template can include default values for any model field (e.g., "titleType": "h3", "classes": ["light"]).
component-models.json — Add a new model entry:
{
"id": "<model-id>",
"fields": [
{
"component": "<field-type>",
"name": "<property-name>",
"label": "<Display Label>",
"valueType": "string"
}
]
}
component-filters.json — Add the block ID to the section filter's components array. For container blocks, also add a new filter entry defining allowed children.
For Distributed Config (creating blocks/<name>/_<name>.json):
Create a single file with all three configs:
{
"definitions": [ ... ],
"models": [ ... ],
"filters": [ ... ]
}
Still add the block to the section filter in the central component-filters.json.
Step 5: Validate
After generating the config, verify:
- ID consistency: The
id in the definition matches what's used in component-filters.json. The template.model value matches the id in component-models.json.
- Filter registration: The block's ID appears in the
section filter's components array (otherwise authors can't add it to pages).
- Field names match block JS: The
name properties in the model fields should produce HTML that the block's decorate() function can consume.
- Semantic collapsing: Paired fields use correct suffixes (e.g.,
image/imageAlt, not image/altText unless intentional).
- Valid JSON: All three files remain valid JSON after edits.
- No duplicate IDs: No model or filter ID conflicts with existing entries.
Reference Files
For detailed information, read these reference files as needed:
- references/architecture.md — How the three files connect, the full AEM→Markdown→HTML pipeline, resource types, field naming conventions, semantic collapsing rules, and RTE filter configuration
- references/field-types.md — Complete reference for all 17 field component types (
text, textarea, richtext, reference, aem-content, aem-content-fragment, aem-experience-fragment, aem-tag, select, multiselect, checkbox-group, radio-group, boolean, number, date-time, container, tab), valueType constraints, required properties, field properties, validation types, conditional fields, and option formats
- references/examples.md — Real examples showing Hero (simple), Embed (simple with URL), Cards (container), Teaser (variants), Product Details (key-value), Article (content fragment), Section configuration, Metadata (textarea), Feature Toggles (checkbox-group), and RTE filter configuration
Common Pitfalls
- Forgetting to add to section filter: The block won't appear in the author's add menu unless it's in the
section filter's components list.
- Wrong resourceType: Almost all custom blocks use
core/franklin/components/block/v1/block. Don't invent custom resource types.
- Mismatched model/filter IDs: The
template.model must exactly match the model id, and template.filter must exactly match the filter id.
- Choosing the wrong text field type: Use
text for single-line strings, textarea for multi-line plain text, and richtext for formatted content. For URLs and page links, use aem-content so authors get the content picker.
- Wrong valueType: Most components enforce a specific
valueType (e.g., boolean must use "boolean", number must use "number", checkbox-group must use "string[]"). Always include valueType and check the field-types reference for the enforced value.
- Container without filter: Container blocks need a
filter (not a model) in their template, and a corresponding filter entry in component-filters.json.
1---2name: ue-component-model-23description: Use this when the user mentions component models, component definitions, component filters, block configuration for the Universal Editor, UE block setup, adding a new block to UE, configuring block properties or block authoring fields, or wants to create an EDS/Franklin block with Universal Editor support, modify block fields, or add a block to the section filter. Covers creating and editing the three JSON files that control how AEM Edge Delivery Services blocks appear and behave in the Universal Editor — component-definition.json, component-models.json, and component-filters.json.4license: Apache-2.05---67# Universal Editor Component Model Configuration89This skill helps you create or edit the three JSON configuration files that control how AEM Edge Delivery Services (EDS) blocks appear and behave in the Universal Editor (UE):10111. **component-definition.json** — Registers blocks in the UE component palette122. **component-models.json** — Defines property panel fields for each block133. **component-filters.json** — Controls where blocks can be placed1415## When to Use1617- Creating a new block that needs UE authoring support18- Adding/modifying fields on an existing block's property panel19- Registering a block so it appears in the author's component palette20- Setting up container blocks with child items21- Adding block variants/style options2223## Workflow2425### Step 1: Understand the Block2627Before generating any configuration, read and analyze:28291. **The block's JS file** (`blocks/<name>/<name>.js`) — understand what content the `decorate(block)` function expects:30 - What does it read from the block div? (images, links, text, classes)31 - Does it expect a flat structure or rows of items?32 - Does it use `block.querySelector('a')` (links/URLs), `block.querySelector('picture')` (images), etc.?33 - Does it check for CSS classes/variants?34352. **The block's CSS file** (`blocks/<name>/<name>.css`) — look for variant-specific styles.36373. **Existing config** — check if entries already exist:38 - Search `component-definition.json` for the block ID39 - Search `component-models.json` for the model ID40 - Search `component-filters.json` for the block in the `section` components list41 - Check for a `blocks/<name>/_<name>.json` distributed config file4243### Step 2: Determine the Block Type4445Based on the JS analysis:4647- **Simple block**: One component with its own fields. Most blocks are this type.48 - Example: Hero, Embed — single model, no children4950- **Container block**: Has repeatable child items (cards, slides, tabs).51 - Clue: JS iterates over `block.children` or creates items from rows52 - Needs: container definition + item definition + filter5354- **Key-value block**: Configuration-style block (2-column key-value pairs).55 - Clue: Each property is independent, not a grid of content56 - Needs: `"key-value": true` in template5758### Step 3: Design the Model Fields5960Map the block's content expectations to component model fields. Read [references/field-types.md](references/field-types.md) for the full field type reference.6162**Common field mappings:**6364| Block expects... | Use component type | Notes |65|-----------------|-------------------|-------|66| An image | `reference` (name: `image`) | Pair with `text` field named `imageAlt` |67| A URL/link | `aem-content` (name: `link` or `url`) | For page links and external URLs |68| Rich text content | `richtext` | For formatted text with headings, lists, links |69| Plain text (single line) | `text` | For titles, labels, short strings |70| Plain text (multi-line) | `textarea` | For descriptions, notes, long text without formatting |71| Heading level choice | `select` with h1-h6 options | Name it `titleType` to auto-collapse with title |72| Style variants | `multiselect` (name: `classes`) | Values become CSS classes on block div |73| Multiple toggles | `checkbox-group` | For multiple independent boolean options |74| Boolean toggle | `boolean` | For show/hide options |75| Number value | `number` | For counts, limits |76| Content Fragment | `aem-content-fragment` | For CF-driven blocks |77| Experience Fragment | `aem-experience-fragment` | For reusable content+layout fragments |78| Content tags | `aem-tag` | For categorization via AEM tag picker |7980**Field naming rules (semantic collapsing):**81- `image` + `imageAlt` → collapsed into `<picture><img alt="...">`82- `link` + `linkText` + `linkTitle` + `linkType` → collapsed into `<a href="..." title="...">text</a>` with optional class83- `title` + `titleType` → collapsed into `<h2>title</h2>` (level from titleType)84- Fields prefixed with `group_` (underscore separator) are grouped into a single cell8586### Step 4: Generate the Configuration8788Generate entries for all three files. The approach depends on whether the project uses centralized or distributed config.8990**Check for distributed config pattern**: If the block directory contains `_<blockname>.json` files (e.g., `blocks/hero/_hero.json`), create a distributed config file instead of editing the central files.9192#### For Centralized Config (editing the three root JSON files):9394**component-definition.json** — Add to the `"Blocks"` group's `components` array:9596```json97{98 "title": "<Block Display Name>",99 "id": "<block-id>",100 "plugins": {101 "xwalk": {102 "page": {103 "resourceType": "core/franklin/components/block/v1/block",104 "template": {105 "name": "<Block Name>",106 "model": "<model-id>"107 }108 }109 }110 }111}112```113114For container blocks, add both the container AND item definitions. The container gets `"filter"` instead of `"model"`, and the item uses `"core/franklin/components/block/v1/block/item"` as resourceType.115116For key-value blocks, add `"key-value": true` to the template.117118Template can include default values for any model field (e.g., `"titleType": "h3"`, `"classes": ["light"]`).119120**component-models.json** — Add a new model entry:121122```json123{124 "id": "<model-id>",125 "fields": [126 {127 "component": "<field-type>",128 "name": "<property-name>",129 "label": "<Display Label>",130 "valueType": "string"131 }132 ]133}134```135136**component-filters.json** — Add the block ID to the `section` filter's `components` array. For container blocks, also add a new filter entry defining allowed children.137138#### For Distributed Config (creating `blocks/<name>/_<name>.json`):139140Create a single file with all three configs:141142```json143{144 "definitions": [ ... ],145 "models": [ ... ],146 "filters": [ ... ]147}148```149150Still add the block to the `section` filter in the central `component-filters.json`.151152### Step 5: Validate153154After generating the config, verify:1551561. **ID consistency**: The `id` in the definition matches what's used in `component-filters.json`. The `template.model` value matches the `id` in `component-models.json`.1572. **Filter registration**: The block's ID appears in the `section` filter's `components` array (otherwise authors can't add it to pages).1583. **Field names match block JS**: The `name` properties in the model fields should produce HTML that the block's `decorate()` function can consume.1594. **Semantic collapsing**: Paired fields use correct suffixes (e.g., `image`/`imageAlt`, not `image`/`altText` unless intentional).1605. **Valid JSON**: All three files remain valid JSON after edits.1616. **No duplicate IDs**: No model or filter ID conflicts with existing entries.162163## Reference Files164165For detailed information, read these reference files as needed:166167- **[references/architecture.md](references/architecture.md)** — How the three files connect, the full AEM→Markdown→HTML pipeline, resource types, field naming conventions, semantic collapsing rules, and RTE filter configuration168- **[references/field-types.md](references/field-types.md)** — Complete reference for all 17 field component types (`text`, `textarea`, `richtext`, `reference`, `aem-content`, `aem-content-fragment`, `aem-experience-fragment`, `aem-tag`, `select`, `multiselect`, `checkbox-group`, `radio-group`, `boolean`, `number`, `date-time`, `container`, `tab`), valueType constraints, required properties, field properties, validation types, conditional fields, and option formats169- **[references/examples.md](references/examples.md)** — Real examples showing Hero (simple), Embed (simple with URL), Cards (container), Teaser (variants), Product Details (key-value), Article (content fragment), Section configuration, Metadata (textarea), Feature Toggles (checkbox-group), and RTE filter configuration170171## Common Pitfalls172173- **Forgetting to add to section filter**: The block won't appear in the author's add menu unless it's in the `section` filter's components list.174- **Wrong resourceType**: Almost all custom blocks use `core/franklin/components/block/v1/block`. Don't invent custom resource types.175- **Mismatched model/filter IDs**: The `template.model` must exactly match the model `id`, and `template.filter` must exactly match the filter `id`.176- **Choosing the wrong text field type**: Use `text` for single-line strings, `textarea` for multi-line plain text, and `richtext` for formatted content. For URLs and page links, use `aem-content` so authors get the content picker.177- **Wrong valueType**: Most components enforce a specific `valueType` (e.g., `boolean` must use `"boolean"`, `number` must use `"number"`, `checkbox-group` must use `"string[]"`). Always include `valueType` and check the field-types reference for the enforced value.178- **Container without filter**: Container blocks need a `filter` (not a `model`) in their template, and a corresponding filter entry in component-filters.json.