All tools
Developer Tool
AEM Content Fragment Model Generator.
Define your fields once and generate an AEM Content Fragment Model (.content.xml), a sample GraphQL query, a JSON spec, and authoring docs — a companion to the AEM Component Generator. Runs entirely in your browser. How to use
Start from a preset
Fields (8)
.content.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
jcr:primaryType="cq:Template"
jcr:title="Article"
jcr:description="Editorial article content fragment."
status="enabled">
<jcr:content
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/console/components/data/entry/v2">
<items jcr:primaryType="nt:unstructured">
<field_title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Title"
name="title"
metaType="text-single"
valueType="string"
required="{Boolean}true"
listOrder="100"/>
<field_subtitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Subtitle"
name="subtitle"
metaType="text-single"
valueType="string"
required="{Boolean}false"
listOrder="200"/>
<field_body
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/editor/components/multitext"
fieldLabel="Body"
name="body"
metaType="text-rich"
valueType="string"
required="{Boolean}true"
listOrder="300"/>
<field_author
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/editor/components/fragmentreference"
fieldLabel="Author"
name="author"
metaType="fragment-reference"
valueType="string"
required="{Boolean}false"
listOrder="400"
modelPath="/conf/<project>/settings/dam/cfm/models/author"/>
<field_heroImage
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/editor/components/contentreference"
fieldLabel="Hero Image"
name="heroImage"
metaType="content-reference"
valueType="string"
required="{Boolean}false"
listOrder="500"/>
<field_tags
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/coral/common/form/tagfield"
fieldLabel="Tags"
name="tags"
metaType="tag"
valueType="string"
required="{Boolean}false"
listOrder="600"/>
<field_publishDate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/datepicker"
fieldLabel="Publish Date"
name="publishDate"
metaType="calendar"
valueType="calendar"
required="{Boolean}false"
listOrder="700"/>
<field_readTimeMinutes
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
fieldLabel="Read Time (min)"
name="readTimeMinutes"
metaType="number"
valueType="long"
required="{Boolean}false"
listOrder="800"/>
</items>
</jcr:content>
</jcr:root>Place the Model XML at /conf/<project>/settings/dam/cfm/models/article/.content.xml (or recreate it in the AEM Models UI). The .zip bundles the XML, GraphQL, TypeScript types, a sample fragment, the JSON spec, and docs. Runs entirely in your browser.