An overview of working with Content Fragments overview-working-with-content-fragments

With Adobe Experience Manager (AEM) as a Cloud Service, Content Fragments allow you to design, create, curate, and publish page-independent content. They allow you to prepare content ready for use in multiple locations, and over multiple channels, ideal for headless delivery, and page authoring.

IMPORTANT
Content Fragments can be accessed from two consoles: Content Fragments and Assets.
There are also two editors available for Content Fragments. (Both editors are accessible from both consoles.)
This section deals with the Content Fragments console and the new Content Fragment editor. These have been developed for headless content delivery (though they can be used for all scenarios)
For further information see:

Content fragments contain structured content:

  • Each fragment is based on a Content Fragment Model.

    • The Content Fragment Model defines the structure of the resulting fragment.
  • Every fragment consists of:

    • Main - an integral part of the fragment that holds the core content; always exists, cannot be deleted
    • Variations - one, or more, permutations of the content, created by the author
  • The structure can range between:

    • Basic

      • For example, a single, multi line text field.
      • Can be used for preparing straightforward content for use in page authoring.
      • Can also be used for headless delivery to your application.
    • Complex

      • A combination of many fields of varying data types, including text, number, boolean, and date and time, among others.
      • Can be used either for preparing more structured content for page authoring, or for headless delivery to your application.
    • Nested

      • The reference data types available allow you to nest your content.
      • Tends to be used for headless delivery to your application.

Content Fragments can also be delivered in JSON format, using the Sling Model (JSON) export capabilities of AEM core components. This form of delivery:

  • enables you to use the component to manage which elements of a fragment to deliver
  • allows bulk-delivery; by adding multiple Content Fragment Core Components on the page being used for API delivery

The number of communication channels is increasing annually. Typically channels refer to the delivery mechanism, either as the:

  • Physical channel; for example, desktop, mobile.
  • Form of delivery in a physical channel; for example, the “product detail page”, “product category page” for desktop, or “mobile web”, “mobile app” for mobile.

However, you (probably) do not want to use the exact same content for all channels - you need to optimize your content according to the specific channel.

Content fragments allow you to:

  • Consider how to reach target audiences efficiently across channels.
  • Create and manage channel-neutral editorial content.
  • Build content pools for a range of channels.
  • Design content variations for specific channels.
  • Add images to your text by inserting assets.
  • Create nested content to reflect the complexity of your data.

These Content Fragments can then be assembled to provide experiences over a variety of channels.

NOTE
Content Fragments and Experience Fragments are different features within AEM:
  • Content Fragments are editorial content, with definition and structure, but without additional visual design and/or layout. They can be used to access structured data, including texts, numbers, and dates, among others.
  • Experience Fragments are fully laid out content; a fragment of a web page.
Experience Fragments can contain content in the form of Content Fragments, but not the other way around.
For further information, see Understanding Content Fragments and Experience Fragments in AEM.

This and the following pages cover the tasks for creating, configuring, maintaining, and using your Content Fragments:

After the fragments have been created, you can:

Main and Variations main-and-variations

Variations are a significant feature of AEM’s Content Fragments. They allow you to create and edit copies of the Main content for use on specific channels, and scenarios, making headless content delivery and page authoring even more flexible.

  • Main

    • Main is not a variation as such, but is the basis of all variations.

    • An integral part of the fragment

      • Every Content Fragment has one instance of Main.
      • Main cannot be deleted.
    • Main is accessible in the fragment editor under Variations.

    note note
    NOTE
    In the editor available from the Assets console, Main is labeled as Master.
  • Variations

    • Renditions of fragment text that are specific to editorial purpose; can be related to channel but is not compulsory, can also be for ad-hoc local modifications.
    • Are created as copies of Main, but can then be edited as required; there is often content overlap between the variations themselves.
    • Can be defined during fragment authoring; from the left panel.
    • Stored in the fragment, to help avoid scattering of content copies.
    • Variations can be compared and synchronized with Main.

Content Fragments and Content Services content-fragments-and-content-services

AEM Content Services are designed to generalize the description and delivery of content in/from AEM beyond a focus on web pages.

They provide the delivery of content to channels that are not traditional AEM web pages, using standardized methods that can be consumed by any client. These channels can include:

  • Single Page Applications
  • Native Mobile Applications
  • other channels and touch-points external to AEM

Delivery is made in JSON format using the JSON Exporter.

AEM Content Fragments can be used to describe and manage structured content. Structured content is defined in models that can contain a variety of content types; including text, numerical data, boolean, date and time, and more.

Together with the JSON export capabilities of AEM core components, this structured content can then be used to deliver AEM content to channels other than AEM pages.

NOTE
See Headless and AEM for an introduction to Headless Development for AEM Sites as a Cloud Service.
NOTE
AEM also supports the translation of fragment content. See Translating Assets for further information.

Content Type content-type

Content fragments are:

Content Fragments are a content structure that:

Fragments with Visual Assets fragments-with-visual-assets

To give authors more control of their content, images can be added to and/or integrated with a Content Fragment.

Assets can be used with a Content Fragment in several ways; each with its own advantages:

  • as a Content Reference
  • within a Multi line text field

Constituent Parts of a Content Fragment constituent-parts-of-a-content-fragment

The Content Fragment assets are made up of the following parts (either directly or indirectly):

  • Fragment Elements

    • Elements correlate to the data fields holding content.
    • You use a Content Fragment Model to create the Content fragment. The elements (fields) specified in the model define the structure of the fragment. These elements (fields) can be of a variety of data-types.
  • Fragment Paragraphs

    • Blocks of text, often multi line, that are delimited as individual entities.

    • Enable content control during page authoring.

  • Fragment Metadata

    note caution
    CAUTION
    Metadata processing profiles do not apply to Content Fragments.
    note caution
    CAUTION
    A Content Fragment Model can often define data fields named Title and Description. If these two fields exist, they are user-defined fields and can be updated in the content area of the editor.
    The Content Fragment, and its variations, also has metadata (property) fields called Title and Description. These two metadata fields are an integral part of any Content Fragment, and variation, and initially defined when the fragment is created. They can be updated in the properties/metadata area of the editor.
  • Main

  • Variations

Required by Fragments required-by-fragments

To create Content Fragments you need:

  • Content Model

    • Are enabled using the Configuration Browser.
    • Are created using Tools.
    • Required to create a fragment.
    • Defines the structure of a fragment (title, content elements, tag definitions).
    • Content Fragment Model definitions require a title and one data element; everything else is optional.
    • The model can define default content - if applicable.
    • Authors cannot change the defined structure when authoring fragment content; though they can open the model editor from the fragment editor.
    • Changes made to a model after dependent Content Fragments have been created, can impact those Content Fragments.

To use your Content Fragments for headless content delivery you also need:

To use your Content Fragments for page authoring you also need:

  • A Content Fragment Component

    • Instrumental to delivering the fragment in HTML and/or JSON format.
    • Required to reference the fragment on a page.
    • Responsible for layout and delivery of a fragment; for example, channels.
    • Fragments need one or more dedicated components to define layout and deliver some or all elements/variations and associated content.
    • Dragging a fragment onto a page in authoring automatically associates the required component.
    • See the Content Fragment Core Component.

Example Usage example-usage

A fragment, with its elements and variations, can be used to create coherent content for multiple channels. When designing your fragment you need to consider what will be used, and where.

WKND Sample wknd-sample

The WKND Site and WKND Shared samples are provided to help you learn about AEM as a Cloud Service.

The WKND project includes:

  • Content Fragment Models available under:

    • .../libs/dam/cfm/models/console/content/models.html/conf/wknd

    • .../ui#/aem/libs/dam/cfm/models/console/content/models.html/conf/wknd-shared

  • Content Fragments (and other content) available under:

    • .../assets.html/content/dam/wknd/en
recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab