Made by DhawalMade by Dhawal
AEMRuns in your browser

AEM Content Fragment Model Generator

Design a content fragment model in a form and download its .content.xml or an installable package, with a GraphQL preview.

Updated 1 November 2026How to use it ↓

Model

AEM names the GraphQL type after it.

Path/conf/mysite/settings/dam/cfm/models/article
Fields (9)
Add:

User guide

What this tool does

The AEM Content Fragment Model Generator lets you design a content fragment model in a form and get everything needed to put it into AEM:

  • the model’s .content.xml, in the same format AEM exports;
  • an installable content package (zip) for Package Manager;
  • a preview of the GraphQL type AEM will create for the model;
  • a sample query, plus the command to save it as a persisted query.

It also imports an existing model, so you can edit it here and export it again. Anything the generator does not edit is kept exactly as it was, down to attribute order and escaping.

It works for both AEM as a Cloud Service and AEM 6.5; the model format is the same on both.

When to use it

  • Starting a headless project: sketch the models with the team, then hand developers a package instead of a list of screenshots.
  • Keeping models in code: generate the .content.xml for your project’s ui.content module so models deploy through your pipeline rather than being clicked together on each environment.
  • Reviewing a model: import it to see every field, its property name, validation and GraphQL type on one screen, with checks for common mistakes.
  • Small edits without the model editor: import, change a label or add an option, export.

How to use it

  1. Pick your AEM version at the top.
  2. Start from a model (Article, Author, Event, FAQ item, Location) or from blank, or import an existing .content.xml.
  3. Set the model details: title, model name (the node name), the /conf configuration it belongs to and a description. The tool shows the full path the model will live at.
  4. Add fields with the buttons under the field list. Click a field to open its settings. The property name is filled in from the label as you type, until you change it yourself.
  5. Group fields into tabs by adding a Tab placeholder where a new tab should start. Use the arrows to order fields.
  6. Read the Checks tab. Fix anything marked as a problem; the package download stays disabled until there are none.
  7. Get the output: copy or download the .content.xml, or download the package from the Package tab.

Data types

Data type Options in the generator GraphQL type
Single line text Max length, placeholder, default, validation pattern, unique, translatable, multiple values String or [String]
Multi line text Default type: rich text, Markdown or plain text MultiFormatString
Number Integer or fraction, default, minimum, multiple values Int / Float
Boolean – Boolean
Date and time Date and time, date only, or time only Calendar / Date / Time
Enumeration Options; render as a dropdown or as checkboxes String
Tags Root tag path [String]
Content reference Root path, images only, multiple values Reference
Fragment reference Allowed models, root path, allow creating new fragments, multiple values The referenced model’s type
Tab placeholder Tab label –

Reading the results

  • .content.xml is the model as AEM stores it under /conf/<site>/settings/dam/cfm/models/<name>. Put it in your project at ui.content/src/main/content/jcr_root/conf/<site>/settings/dam/cfm/models/<name>/.content.xml.
  • GraphQL type shows the type AEM generates. The type and query names come from the model title, so renaming the model changes your API. Confirm the exact names in the GraphiQL IDE on your instance.
  • Sample query lists fragments of this model with every field. Multi-line text asks for the format you chose, and references ask for their path.
  • Package lists the files in the zip and gives install steps, plus a curl command that saves the sample query as a persisted query.
  • Checks flags invalid or duplicate property names, names reserved by AEM GraphQL, enumerations without options, malformed model paths in fragment references, invalid regular expressions, and validation patterns without an error message.

Worked example

An events team wants to publish workshops and webinars to the website and a mobile app. Choose Start from a model › Event. The model gets nine fields: name, start and end, a format enumeration (in person, online, hybrid), venue, an online link validated to start with https://, a price that cannot be negative, a rich-text description and a banner image.

The GraphQL type AEM will create:

type EventModel {
  _path: ID
  _variation: String
  eventName: String
  startDate: Calendar
  endDate: Calendar
  format: String
  venue: String
  onlineLink: String
  price: Float
  eventDescription: MultiFormatString
  banner: Reference
}

And a query the app can use, ready to save as a persisted query:

query EventList {
  eventList {
    items {
      _path
      eventName
      startDate
      format
      price
      eventDescription {
        html
      }
    }
  }
}

Download the package, install it in Package Manager, and the Event model appears under your configuration, ready for authors.

Limits and privacy

  • Everything runs in your browser. Your model is saved in this browser (local storage) so a refresh keeps it; nothing is sent to this site.
  • Field formats come from real AEM exports, including Adobe’s WKND sample models, and the tool’s tests check that importing and exporting those models gives back the identical file.
  • JSON Object fields cannot be created here yet, because no reference export was available to copy their exact format. Imported models keep them unchanged, along with any other data type or attribute the generator does not edit.
  • Date-only and time-only fields follow AEM’s date and time pattern. If you rely on them, import one exported from your instance to compare.
  • Installing the package replaces a model at the same path. Fragments based on it keep their content, but removing a field from a model hides that field’s data from authors and APIs.
  • AEM 6.5: GraphQL for content fragments needs a recent service pack and a GraphQL endpoint for your configuration.

Further reading

FAQ

Where does AEM store content fragment models?
Under /conf/<site>/settings/dam/cfm/models/<name>. Content Fragment Models must be enabled for that configuration in the Configuration Browser.
Can I edit a model that already exists?
Yes. Import its .content.xml, make your changes and export. Attributes and field types the generator does not edit are written back unchanged.
How do I deploy the model to AEM as a Cloud Service?
Add the generated .content.xml to your project’s ui.content module under the same /conf path and deploy through Cloud Manager. Use the zip package for local SDK and AEM 6.5 instances.
Why does my GraphQL type have a different name?
AEM builds type and query names from the model title. The preview follows that rule, but check the names in the GraphiQL IDE, especially for titles with acronyms or special characters.
Is my model sent anywhere?
No. The generator runs entirely in your browser and keeps your work in this browser’s local storage.