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

Fields
.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_body
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="dam/cfm/models/editor/components/multitext"
                    fieldLabel="Body"
                    name="body"
                    metaType="text-rich"
                    valueType="string"
                    required="{Boolean}false"
                    listOrder="200"/>
                <field_author
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                    fieldLabel="Author"
                    name="author"
                    metaType="text-single"
                    valueType="string"
                    required="{Boolean}false"
                    listOrder="300"/>
                <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="400"/>
        </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). Field types map to AEM CFM data types. Runs entirely in your browser.