Templates & Components

Experience Fragments

AEM Experience Fragments (XF) are modular content units designed to facilitate the creation and management of reusable and consistent content.

 

Experience Fragments may be referenced on multiple pages. If edited, the changes will reflect on all pages.

 

Note that the Header and Footer (which appear on all pages) and Side Navigation (which appears on agency-specific templates) are already created. They can only be edited by site admins.

 

This guide provides general details on Experience Fragments. For details on creating and editing specific Experience Fragments, please reference their user guides.

Overview

Name: Experience Fragment 

Authors who can use: varies by Experience Fragment:

Templates/page types that can use: all

Required or optional: optional 

Authoring Fields

XFs can be created either in the Experience Fragment section of AEM, or on the page. Use the former method to create XFs from scratch and add them to page. Use the latter method to group components already authored on a page, save them as one, and add them to other pages.

Creating an Experience Fragment in the AEM Experience Fragment section

1. On the Navigation page, select Experience Fragments.

Navigation landing page with Experience Fragments as option

2. Find the desired page path where the XF should be stored. Once on the desired page path, select Create, then Experience Fragment from the top right corner. In the example below, the XF will be part of the DHS folder.

Experience Fragment navigation path under DHS folder, with the Create button in top right corner

3. Select Web Variation, and select Next from the top right corner.

a. Author the required title field.

b. Optional fields:

i. Name

ii. Description

iii. Tags

c. Click Create.

d. Click Open to begin editing the XF immediately. Click Done to return to the navigation screen. The XF can be edited at any time. If clicking Open, follow steps 4-6 below.

4. Once the XF is created, a template page will open. Add as many components as wanted to the XF. Some stylized components are only available as XFs (ex. Header, Footer, etc.).

5. Author as you would any page.

6. Publish the Experience Fragment. It is now available to be added to pages.

Experience Fragment authoring, showing Title, Text, and Social Media components added. Figure A: Sample XF with Title, Text, and Social Media components authored.

Creating an Experience Fragment on the page

1. Author a page as normal.

2. Select component(s) to turn into an XF. To select multiple, use the group option from the editing toolbar. All components should be highlighted with a blue box.

3. Select the Convert to experience fragment variation option from the editing toolbar.

The component editing toolbar, with a green square around the Convert to Experience Fragment option (last option in the toolbar). Figure B: Component editing toolbar, with option to Convert to Experience Fragment in the green square.

4. Convert to experience fragment variation

a. Action dropdown:

i. Create a new Experience Fragment: Use this option to create a new XF.

ii. Add to an existing Experience Fragment: Use this option to add an XF to an existing XF folder. It will not be added to the existing XF itself.

b. Experience Fragment path field: Link to the XF folder.

c. Template field: Select Web Variation template.

d. Variation title field: Name the XF.

e. Variation tags field: Optionally add tags.

5. Click Done. The component(s) are now saved as an XF. They can found in the XF section and added to pages as described below.

 

Adding an Experience Fragment to a page

1. To use an existing XF, add the Experience Fragment component to the page like you would any other component.

Once on the desired page in Edit mode, add the Accordion by doing the following:

Option 1: Double click on “Drag components here.” A modal titled “Insert New Component” will pop up. Type “Experience Fragment” in the search bar, or scroll to Experience Fragment in the list. Double click to add to page.

Option 2: On the left hand rail, navigate to the Components tab. Type “Experience Fragment” in the search bar, or scroll to Experience Fragment in the list. Double click to add to page.

2. With the edit wrench, open the Experience Fragment component.

3. Variation field: Use the pathfinder to navigate to Experience Fragments section where the Web Variation was created

Experience Fragment authoring, with variation field to link to the XF

4. The XF now displays on the page. Its content cannot be edited without reentering the Experience Fragment section authoring dialog. It can be moved, copied, deleted, etc., from the page.

The Experience Fragment created in the example above now shows on a regular content page. Figure C: The sample XF now displays on a DHS page.

Editing an existing Experience Fragment

1. On the Navigation page, select Experience Fragments.

2. Click through the folders until you reach the web variation of the XF. Select the checkbox, then Edit from the top menu.

Path to select an XF to edit.

3. When the authoring page opens, edit as normal.

4. Publish the XF. Changes will reflect on all pages that reference it.

Accessibility

  • Check accessibility details for each component added to the XF.

Other tips

  • Common use cases for XFs, with their components:
    • Agency branding: Container + Column Control + Image + Title + Social Media
    • Related pages/quick links: List
    • Contact info: Card Group
    • Accessibility details: Container + Text
    • Social media: Social Media