Using Experience Fragments using-experience-fragments
This page covers the following topics:
- Overview
- Using Experience Fragments in AEM Screens
- Propagating Changes to the Page
Overview overview
An Experience Fragment is a group of one or more components including content and layout that can be referenced within pages. Experience Fragments can contain any component. For example, it can contain one or multiple components that can contain anything within a paragraph system that is referenced into the complete experience or requested by a third endpoint.
Using Experience Fragments in AEM Screens using-experience-fragments-in-aem-screens
We.Retail
as a demo project from where the Experience Fragment is applied from a Sites page to an AEM Screens project.As an example, the following workflow demonstrates the use of Experience Fragments from We.Retail
in Sites. You can choose a web page and use that content in your AEM Screens channel in one of your projects.
Pre-requisites pre-requisites
Creating a Demo Project with a Channel
Creating a Project
- To create a project, click Create Screens Project.
- Enter the Title as DemoProject.
- Click Save.
A DemoProject is added to your AEM Screens.
Creating a Channel
-
Navigate to the DemoProject you created and click the Channels folder.
-
Click Create from the action bar so you can open the wizard.
-
Choose the Sequence Channel template from the wizard and click Next.
-
Enter the Title as TestChannel and click Create.
A TestChannel is added to your DemoProject.
Creating an Experience Fragment creating-an-experience-fragment
Follow the steps below to apply the content from We.Retail
to your TestChannel in DemoProject.
-
Navigate to a Sites page in We.Retail
-
Navigate to Sites and click
We.Retail
> United States > English > Equipment and click this page so you can use it as an Experience Fragment for your Screens channel. -
Click Edit from the action bar so you can open the page you want to use as an Experience Fragment for your Screens channel.
-
-
Reusing the Content
- Click the fragment that you want to include in your channel.
- Click the last icon from the right so you can open the Convert to Experience Fragment dialog box.
-
Creating an Experience Fragment
-
Choose the Action as Create a new Experience Fragment.
-
Click the Parent path.
-
Click the Template. Choose the Experience Fragment - Screens Variation template here (value in the field
/libs/settings/screens/experience-fragments/templates/experience-fragment-template-screens
). -
Enter the Fragment Title as ScreensFragment.
-
To complete the creation of a new Experience Fragment, click the check mark.
To select an easier option, click the check mark to the right of the field so you can open the selection dialog box.
-
-
Creating Live Copy of Experience Fragment
- Navigate to the AEM home page.
- Click Experience Fragments and highlight the ScreensFragment and click Variation as live-copy, as shown in the figure below:
c. Click the ScreensFragment from the Create Live Copy wizard and click Next.
d. Enter the Title and Name as Screens.
e. Click Create so you can create the Live Copy.
f. Click Done so you can move back to the ScreensFragment page.
note note NOTE After you have created an AEM Screens fragment, you can edit the properties of your fragment. Click the fragment and click Properties from the action bar. Editing Properties of a Screens Fragment
-
Navigate to the ScreensFragment (you created in the preceding steps) and click Properties from the action bar.
-
Click the Offline Config tab, as shown in the figure below.
You can add the Client-side Libraries (Javaâ„¢ and CSS) and Static Files to your Experience Fragment.
The following example shows the addition of client-side libraries and the fonts as a part of static files to your Experience Fragment.
-
Using Experience Fragment as a Component in Screens Channel
-
Navigate to the Screens channel where you want to use the Screens fragment.
-
Click the TestChannel and click Edit from the action bar.
-
Click the components icon from the side tab.
-
Drag and drop the Experience Fragment to your channel.
e. Click the Experience Fragment component and click the top left (wrench) icon so you can open the Experience Fragment dialog box.
f. Click the Screens Live Copy of the fragment that you created in Step 3 in Path.
f. Click the Screens Live Copy of the fragment that you created in Step 3 in the Experience Fragment.
h. Enter the milliseconds in Duration.
i. Click the Offline Config from the Experience Fragments dialog box so you can define the client-side libraries and the static files.
note note NOTE To add client-side libraries, or the static files in addition to what you configured in step (4), you can add from the Offline Config tab in the Experience Fragment dialog box. j. Click the check mark so you can complete the process.
-
Validating the Result validating-the-result
After completion of the preceding steps, you can validate your Experience Fragment in ChannelOne by:
- Navigating to the TestChannel.
- Selecting the Preview from the action bar.
View the content from the Sites page (live-copy of the Experience Fragment) in your channel, as shown in the figure below:
Propagating Changes to the Page propagating-changes-from-the-master-page
Live Copy refers to the copy (of the source), maintained by synchronization actions as defined by the rollout configurations.
Because the Experience Fragment you created is a Live Copy from the Sites pages, and you change that particular fragment from the primary page, you view the changes in your channel. Or, view the destination where you have used the Experience Fragment.
Follow the steps below to propagate changes from the primary channel to your destination channel:
-
Click the Experience Fragment from the Sites (primary) page and click the pencil icon so you can edit the items in the Experience Fragment.
-
Click the Experience Fragment and click the wrench icon so you can open the dialog box to edit the images.
-
The Product Grid dialog box opens.
-
You can edit any of the images. For example, here the first image is replaced in this fragment.
-
Click the Experience Fragment and click the Rollout icon so you can propagate changes to the fragment that is used in your channel.
-
Click Rollout.
Notice that the changes are rolled out.
Validating the Changes validating-the-changes
Follow the steps below to confirm the changes in your channel:
-
Navigate to the Screens > Channels > TestChannel.
-
Click Preview from the action bar.
The following image illustrates the changes in your TestChannel: