This article builds on these so you understand how to create your own Content Fragment Models for your AEM headless project.
Then the Content Fragments Models can be created and the structure defined. This can be done under Tools -> Assets -> Content Fragment Models.
After selecting this you navigate to the location for your model and select Create. Here you can enter various key details.
The option Enable model is activated by default. This means that your model will be available for use (in creating Content Fragments) as soon as you have saved it. You can deactivate this if you want - there are opportunities later to enable (or disable) an existing model.
Confirm with Create and you can then Open your model to start defining the structure.
When you first open a new model you will see - a large blank space to the left, and a long list of Data Types at the right:
So - what’s to be done?
You can drag instances of the Data Types onto the left space - you’re already defining your model!
Once you add a data type you’ll be required to define the Properties for that field. These depend on the type being used. For example:
You can add as many fields as you need. For example:
Your content authors do not see the actual Data Types and Properties that you’ve used to create your models. This means that you might have to provide help and information on how they complete specific fields. For basic information you can use the Field Label and Default Value, but more complex cases project specific documentation might need to be considered.
See Additional Resources - Content Fragment Models.
Managing your Content Fragment Models involves:
Content fragment models need to be published when/before any dependent content fragments are published.
If an author tries to publish a content fragment for which the model has not yet been published, a selection list will indicate this and the model will be published with the fragment.
As soon as a model is published it is locked into a READ-ONLY mode on author. This aims to prevent changes that would result in errors to existing GraphQL schemas and queries, especially on the publish environment. It is indicated in the console by Locked.
When the model is Locked (in READ-ONLY mode), you can see the contents and structure of models but you cannot edit them directly; though you can manage Locked models from either the console, or the model editor.
Now that you have learned the basics, the next step is to start creating your own Content Fragment Models.
Basic Handling - this page is primarily based on the Sites console, but many/most features are also relevant for navigating to, and taking action on, Content Fragment Models under the Assets console.
Getting Started Guides