Content Fragment Models content-fragment-models

CAUTION
AEM 6.4 has reached the end of extended support and this documentation is no longer updated. For further details, see our technical support periods. Find the supported versions here.
CAUTION
Some Content Fragment functionality requires the application of AEM 6.4 Service Pack 2 (6.4.2.0) or later.

Content Fragment Models define the structure of content for your content fragments.

Enable Content Fragment Models enable-content-fragment-models

CAUTION
If you do not enable Content Fragment Models, the Create option will not be available for creating new models.

To enable content fragment models you need to:

  • Enable the use of content fragment models in the configuration manager
  • Apply the configuration to your Assets folder

Enable Content Fragment Models in Configuration Manager enable-content-fragment-models-in-configuration-manager

To create a new Content Fragment Model you must first enable them using the Configuration Manager:

  1. Navigate to Tools, General, then open the Configuration Browser.

  2. Select the location appropriate to your website.

  3. Use Create to open the dialog, where you:

    1. Specify a Title.
    2. Select Content Fragment Models to enable their use.

    cfm-6420-09

  4. Select Create to save the definition.

Apply the Configuration to your Assets Folder apply-the-configuration-to-your-assets-folder

When the configuration global is enabled for content fragment models, then any models that users create can be used in any Assets folder.

To use other configurations (i.e. excluding global) with a comparable Assets folder, then you have to define the connection. This is done using Configuration in the Cloud Services tab of the Folder Properties of the appropriate folder.

Creating a Content Fragment Model creating-a-content-fragment-model

  1. Navigate to Tools, Assets, then open Content Fragment Models.

  2. Navigate to the folder appropriate to your configuration.

  3. Use Create to open the wizard.

    note caution
    CAUTION
    If the use of content fragment models have not been enabled, the Create option will not be available.
  4. Specify the Model Title. You can also add a Description if required.

    cfm-6420-10

  5. 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.

Defining your Content Fragment Model defining-your-content-fragment-model

The content fragment model effectively defines the structure of the resulting content fragments. Using the model editor you can add, and configure, the required fields:

CAUTION
Editing an existing content fragment model can impact dependent fragments.
  1. Navigate to Tools, Assets, then open Content Fragment Models.

  2. Navigate to the folder holding your content fragment model.

  3. 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:

    • left: fields already defined
    • right: Data Types available for creating fields (and Properties for use once fields have been created)
    note note
    NOTE
    When a field is Required, the Label indicated in the left pane will be marked with an asterix (*).

    cfm-6420-12

  4. To Add a Field

    • Drag a required data type to the required location for a field:

    cfm-6420-11

    • 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. For example:

    cfm-6420-13

  5. To Remove a Field

    Select the required field, then click/tap the trash-can icon. You will be asked to confirm the action.

    cf-32

  6. After adding all required fields, and defining the properties, use Save to persist the definition. For example:

    cfm-6420-14

Deleting a Content Fragment Model deleting-a-content-fragment-model

CAUTION
Deleting a content fragment model can impact dependent fragments.

To delete a content fragment model:

  1. Navigate to Tools, Assets, then open Content Fragment Models.

  2. Navigate to the folder holding your content fragment model.

  3. Select your model, followed by Delete from the toolbar.

    note note
    NOTE
    If the model is referenced a warning will be given. Take action appropriately.

Publishing a Content Fragment Model publishing-a-content-fragment-model

Content fragment models need to be published when/before any dependent content fragments are published.

To publish a content fragment model:

  1. Navigate to Tools, Assets, then open Content Fragment Models.

  2. Navigate to the folder holding your content fragment model.

  3. Select your model, followed by Publish from the toolbar.

    note note
    NOTE
    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.
recommendation-more-help
4452738f-2bdf-4cd4-9b45-905a69d607ad