AEM in 40 Days
CalendarPhase 4 · Authoring & Content Operations

Day 26 of 40

Experience and Content Fragments

Two very different tools with confusingly similar names

~45 min read6 videos4 source pages

By the end of today you should be able to

  1. State the difference between Experience Fragments and Content Fragments precisely
  2. Choose the right one for a given requirement
  3. Explain Content Fragment Models and variations
  4. Explain how Experience Fragments are reused, including outside AEM

Two things, confusingly similar names

The distinction is genuinely simple once stated plainly, and getting it wrong causes real architectural pain:

  • Experience Fragmentpresentation. A group of assembled components with layout and styling. It is a piece of a page you can reuse as a page fragment.
  • Content Fragmentcontent. Structured, channel-neutral data with no layout at all. It is a record: fields with types.
Experience Fragment = components + layout, reused as rendered experience.
Content Fragment = structured fields, rendered however the consuming channel likes.

Experience Fragments

An XF lives under /content/experience-fragments and is built with the same page editor and the same components you already use. Typical uses: site header and footer, a promotional banner reused across many pages, a campaign block shared between web and email.

  • Variations — an XF can have several variations of the same experience (web, mobile, email), sharing a master.
  • Building blocks — XFs can be composed from other XFs.
  • Referenced on a page via the Experience Fragment component; the page renders the fragment's components inline.
  • Exported — an XF can be delivered as HTML for use outside AEM, or as an offer to Adobe Target for personalisation.

The header and footer of a WKND-style template are XFs referenced from the template's structure — which is why editing the XF updates every page at once.

Content Fragments

A CF is defined by a Content Fragment Model: a schema of typed fields — text, rich text, number, date, boolean, enumeration, tags, content reference, fragment reference. Models live in /conf and must be enabled per configuration.

Model: Adventure
  title          Single line text
  description    Multi line text (rich)
  price          Number
  difficulty     Enumeration [Beginner, Intermediate, Advanced]
  primaryImage   Content reference
  itinerary      Fragment reference (multiple)

Once a model exists, authors create fragments against it. A fragment has:

  • Variations — alternative renderings of the same content for different channels, e.g. a shortened summary for mobile. The master is canonical; variations override selected fields.
  • Associated content — assets linked to the fragment for use wherever it appears.
  • Metadata and tags — for search and filtering.
The deciding question

"Would this content be delivered to a channel that is not an AEM-rendered web page?" If yes — a mobile app, a kiosk, a partner API — it is a Content Fragment. If it only ever appears as part of an AEM page and its layout is the point, it is an Experience Fragment.

Using them

  • On a page, the Content Fragment component renders selected fields of a fragment, and the Experience Fragment component embeds an XF.
  • Headless delivery is where CFs earn their keep: GraphQL and OpenAPI endpoints serve them as JSON to any client. That is out of scope for this traditional-AEM track, but it is the reason the CF model exists.
  • Both are translatable, and both participate in MSM — worth knowing before you scatter them across locales.

Where people go wrong

  • Using a CF for a page banner. If it only ever renders as one styled block in AEM, an XF is simpler and gives authors a real editing experience.
  • Using an XF for product data. Structured records forced into a layout become impossible to query, filter or deliver anywhere else.
  • Modelling a CF too loosely. A model that is one big rich-text field is a page with extra steps; the value is in the typed fields.
Today's takeaway

Experience Fragment = assembled presentation. Content Fragment = structured, channel-neutral data. Ask whether the content will ever leave the AEM-rendered page.

Watch

Adobe's own videos for this topic. They load only when you press play.

Experience Fragments - Overview
Building Blocks with Experience Fragments
Defining Content Fragment Models
Creating Content Fragments
Downloading Content Fragments
Content Fragment Editorial Capabilities

Read on Experience League

The primary sources these notes are drawn from.

Your notes

Saved automatically to this browser.

Check yourself

10 questions on today's material. 80% to pass.

Take the quiz