The AEM GraphQL API for Content Fragments Delivery is available on request.
Please reach out to Adobe Support to enable the API for your AEM as a Cloud Service program.
Content Fragment Models define the structure of content for your content fragments.
To use Content Fragment Models you:
Navigate to Tools, Assets, then open Content Fragment Models.
Navigate to the folder appropriate to your configuration.
Use Create to open the wizard.
If the use of content fragment models have not been enabled, the Create option will not be available.
Specify the Model Title. You can also add Tags, and a Description if required.
Use Create to save the empty model. A message will indicate the success of the action, you can select Open to immediately edit the model, or Done to return to the console.
The content fragment model effectively defines the structure of the resulting content fragments using a selection of Data Types. Using the model editor you can add instances of the data types, then configure them to create the required fields:
Editing an existing content fragment model can impact dependent fragments.
Navigate to Tools, Assets, then open Content Fragment Models.
Navigate to the folder holding your content fragment model.
Open the required model for Edit; use either the quick action, or select the model and then the action from the toolbar.
Once open the model editor shows:
When a field as Required, the Label indicated in the left pane will be marked with an asterix (*).
To Add a Field
Drag a required data type to the required location for a field.
Once a field has been added to the model, the right panel will show the Properties that can be defined for that particular data type. Here you can define what is required for that field.
Many properties are self-explanatory, for additional details see Properties.
To Remove a Field
Select the required field, then click/tap the trash-can icon. You will be asked to confirm the action.
Add all required fields, and define the related properties, as required.
Select Save to persist the definition.
A selection of data types is available for defining your model:
Many properties are self-explanatory, for certain properites additional details are below:
Render As
The various options for realizing/rendering the field in a fragment. Often this allows you to define whether the author will see a single instance of the field, or will be allowed to create multiple instances.
Field Label
Entering a Field Label will autogenerate a Property Name, which can then be manually updated if required.
Validation
Basic validation is available by mechanisms such as the Required property. Some data types have addition validation fields. See Validation for further details.
For the data type Multi line text it is possible to define the Default Type as either:
If not specified, the default value Rich Text is used for this field.
Changing the Default Type in a content fragment model will only take effect on an existing, related, content fragment after that fragment is opened in the editor and saved.
Various data types now include the possibility to define validation requirements for when content is entered in the resulting fragment:
For full control over the use of your Content Fragment Models they have a status that you can set.
Once a model has been created it needs to be enabled so that it:
To enable a Model that is flagged as either:
You use the Enable option from either:
A model can also be disabled so that:
To disable a Model that is flagged as Enabled you use the Disable option from either:
Deleting a content fragment model can impact dependent fragments.
To delete a content fragment model:
Navigate to Tools, Assets, then open Content Fragment Models.
Navigate to the folder holding your content fragment model.
Select your model, followed by Delete from the toolbar.
If the model is referenced a warning will be given. Take action appropriately.
Content fragment models need to be published when/before any dependent content fragments are published.
To publish a content fragment model:
Navigate to Tools, Assets, then open Content Fragment Models.
Navigate to the folder holding your content fragment model.
Select your model, followed by Publish from the toolbar.
The published status will be indicated in the console.
If you 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.
Content fragment models can be unpublished if they are not referenced by any fragments.
To unpublish a content fragment model:
Navigate to Tools, Assets, then open Content Fragment Models.
Navigate to the folder holding your content fragment model.
Select your model, followed by Unpublish from the toolbar.
The published status will be indicated in the console.