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 (
) — understand what content the
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 (links/URLs),
block.querySelector('picture')
(images), etc.?
- Does it check for CSS classes/variants?
-
The block's CSS file (
) — look for variant-specific styles.
-
Existing config — check if entries already exist:
- Search
component-definition.json
for the block ID
- Search for the model ID
- Search for the block in the 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 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: 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 | (name: ) | Pair with field named |
| A URL/link | (name: or ) | For page links and external URLs |
| Rich text content | | For formatted text with headings, lists, links |
| Plain text (single line) | | For titles, labels, short strings |
| Plain text (multi-line) | | For descriptions, notes, long text without formatting |
| Heading level choice | with h1-h6 options | Name it to auto-collapse with title |
| Style variants | (name: ) | Values become CSS classes on block div |
| Multiple toggles | | For multiple independent boolean options |
| Boolean toggle | | For show/hide options |
| Number value | | For counts, limits |
| Content Fragment | | For CF-driven blocks |
| Experience Fragment | | For reusable content+layout fragments |
| Content tags | | For categorization via AEM tag picker |
Field naming rules (semantic collapsing):
- + → collapsed into
- + + + → collapsed into
<a href="..." title="...">text</a>
with optional class
- + → collapsed into (level from titleType)
- Fields prefixed with (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
files (e.g.,
), 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
group's
array:
json
{
"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
instead of
, and the item uses
"core/franklin/components/block/v1/block/item"
as resourceType.
For key-value blocks, add
to the template.
Template can include default values for any model field (e.g.,
,
).
component-models.json — Add a new model entry:
json
{
"id": "<model-id>",
"fields": [
{
"component": "<field-type>",
"name": "<property-name>",
"label": "<Display Label>",
"valueType": "string"
}
]
}
component-filters.json — Add the block ID to the
filter's
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:
json
{
"definitions": [ ... ],
"models": [ ... ],
"filters": [ ... ]
}
Still add the block to the
filter in the central
.
Step 5: Validate
After generating the config, verify:
- ID consistency: The in the definition matches what's used in . The value matches the in .
- Filter registration: The block's ID appears in the filter's array (otherwise authors can't add it to pages).
- Field names match block JS: The properties in the model fields should produce HTML that the block's function can consume.
- Semantic collapsing: Paired fields use correct suffixes (e.g., /, not / 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 (, , , , , , , , , , , , , , , , ), valueType constraints, required properties, field properties, validation types, conditional fields, and option formats
- — 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 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 must exactly match the model , and must exactly match the filter .
- Choosing the wrong text field type: Use for single-line strings, for multi-line plain text, and for formatted content. For URLs and page links, use so authors get the content picker.
- Wrong valueType: Most components enforce a specific (e.g., must use , must use , must use ). Always include and check the field-types reference for the enforced value.
- Container without filter: Container blocks need a (not a ) in their template, and a corresponding filter entry in component-filters.json.