Blogs > Experience Fragments in AEM
AEM Sites
Experience Fragments in AEM
| September 30, 2024Hi, happy to find you here. Hope you are doing well.
Experiencefragments in AEM
Here we will be understanding the functionality of experience fragments. How to create them and what functionality do they provide.
Introduction
Suppose you have a component which will remain the same throughout the pages of your website such that even its authored content also remains the same, it becomes tidious to add the component on every page and author the same data to it. In order to solve this, aem provides experience fragments. It provides a component to become an experience fragment and serve the discussed functionality.
Creation of an Experience Fragment
Here we will be using a demo componentnent as an experience fragment. To create n experience fragment :
-
Go to the experience fragments from navigation, and create a folder. In this folder, you will have your experience fragment.
-
Now create an experience fragment. We need to select a template and for the purpose we are using web variation.
-
Go to edit template, add the demo component to the policies and now add the component to the container. This is how you have succcessfully created your experience fragment. Author it and see the result on the page. For the purpose we are displaying the text and path fields only via properties.
-
Now having created the experience fragment, you need to add this in your website pages. This is done by adding the experience fragment component to the template and authoring it by providing the path to our experience fragment.
-
Now this creates your experience fragment particular to the template. Every page created by this template will have this component.
Conclusion
Here we have understood how to create an experience fragment and how to use them. Also we have briefly discussed the use case of experience fragments.
I hope you enjoyed blog and the concept of experience fragments.