Adobe Experience Manager (AEM) Experience Fragments and Content Fragments have a lot in common. Both features enable teams to create content once and reuse it across multiple locations. However, they are designed for different purposes and offer different capabilities.
Understanding the distinction can help teams choose the right approach for their content and digital experiences. Let’s break down what each feature is capable of, when to use each one and the key differences between them.
Experience Fragments
What is an Experience Fragment?
An Experience Fragment is a reusable group of AEM components that includes both content and visual layout. It is a fully designed section of an experience (page), such as a hero banner, promotional block, or footer, that can be reused across multiple pages.
Experience Fragments are created using the AEM page editor and are based on templates that define their structure and available components. They can also contain other Experience Fragments and can have multiple variations based on the same root content.
How Does it Work?
Authors can build a section using AEM components, arrange those components in a layout, and then reuse the finished experience wherever it is needed.
Since the layout and styling are part of the fragment, authors can update the Experience Fragment itself rather than recreating the same section across individual pages. Updates to the original fragment are reflected wherever it is referenced, helping maintain a consistent experience. When different versions are needed, authors can also create variations of an Experience Fragment to support different channels, audiences, or contexts.
When Should You Use Experience Fragments?
Use Experience Fragments when you want to reuse a designed experience or page region, particularly when its visual presentation is important. They are best suited for:
- Reusing designed page sections: When you want to build a section such as a hero banner, promotional block, header or footer, and reuse it across multiple AEM pages.
- Maintaining visual consistency: When the layout, typography, styling, and components need to remain consistent wherever the experience is used.
- Creating channel or context-specific experiences: When you need different variations of a designed experience for specific channels, audiences, or contexts.
Content Fragments
What is a Content Fragment
A Content Fragment is a reusable piece of structured content without any visual design or layout. It allows teams to create, manage, and publish editorial content independently from the pages or experiences where it will ultimately appear.
Content Fragments are channel-neutral, meaning the same underlying content can be delivered to different locations and channels without being tied to a specific design.
How Does it Work?
Content Fragments are created from Content Fragment Models, which define the structure and fields available within the fragment. These fields can range from simple text to more complex data types such as numbers, booleans, references, and nested content.
Content Fragments are stored as page-independent assets, allowing authors to create and manage editorial content and build content pools that can be used across different channels. They also enable authors to create variations of content for different purposes, add associated assets such as images, and create nested content when more complex structures are required. In-between content is also supported, which allows additional content to be added within an existing fragment after it has been used or referenced.
Content Fragments can also be delivered through APIs, making them particularly useful for headless content delivery.
When Should You Use Content Fragments?
Use Content Fragments when you need to create and manage structured, reusable content, independently from its presentation. They are best suited for:
- Headless content delivery: Delivering content to mobile apps, single-page applications (SPAs), websites, or other external channels through APIs.
- Working with structured content: When content requires a defined structure, such as articles, product information (e.g. Price, SKU, Image, Description), or other data with multiple fields.
- Supporting different presentations: When the same content needs to be presented differently depending on audience, channel, or use case.
Key Differences
While both features support content reuse, their primary difference is what is being reused. Let’s break down the key differences:
- Experience Fragments contain fully designed page regions including content, components, layout, and styling. This makes them ideal for reusing consistent, visually complete experiences across pages and channels.
- Content Fragments contain structured content, such as text and data, without a predefined layout or styling. This makes them flexible for delivery across different channels and experiences.
- Experience Fragments can contain Content Fragments, allowing structured content to be incorporated into a design experience. Content Fragments, however, do not contain Experience Fragments.
- Experience Fragments provide consistency in how an experience (page) is presented, while Content Fragments provide flexibility in how content is presented.
Ultimately, the feature choice comes down to whether you need to reuse structured content independently of its presentation or a fully designed experience with its layout and styling intact.
Not sure which AEM features are right for your needs? Our experts can help you understand your options, identify the right use cases, and build an effective AEM strategy.
