How to Create a Content Fragment in AEM.

Mayur Satav
4 min readApr 10, 2022

--

Simplified step by step instructions to create Content Fragment.

How to Create a Content Fragment in AEM by Mayur Satav

Content Fragments are editorial content without any experience. Which can be reused on multiple pages. To create a content fragment we require a content fragment model. The content fragment model defines the structure of content. Once the Content fragment Model is created it can be used to create content fragments for data sets. It is implemented as a dam:Asset. The content fragment can be used in AEM pages using the content fragment component or you can also use it as Raw JSON for 3rd party applications.

How to Create a Content Fragment in AEM by Mayur Satav

Step1: First of all we have to create a model for our content fragment. In this step, we are going to create a model for doctor info.

Go to Tools -> Assets ->Content Fragment models.

How to Create a Content Fragment in AEM by Mayur Satav

Step2: Open your folder and select create option.

How to Create a Content Fragment in AEM by Mayur Satav
How to Create a Content Fragment in AEM by Mayur Satav

Give a title to your CF model and make sure that enable model checkbox is checked. You can keep the rest of the fields as it is.

Step 3: Open your created CF Model and now drag and drop different data type fields given in the right pane as per your requirements.

How to Create a Content Fragment in AEM by Mayur Satav

you can also edit properties like field label, property name etc.

How to Create a Content Fragment in AEM by Mayur Satav

Once you are done then select save.

How to Create a Content Fragment in AEM by Mayur Satav

great work !!! your CF Model is now ready for further use.

Step 4: Now in this step we will configure our CF Model path in the properties of the content fragment folder.

Go to Navigation ->Assets and then select Files.

How to Create a Content Fragment in AEM by Mayur Satav

select your folder and go to properties.

How to Create a Content Fragment in AEM by Mayur Satav

Step 5: now go to the Cloud Services tab then under Cloud Configuration select our CF Model folder and select Save & Close.

How to Create a Content Fragment in AEM by Mayur Satav

Step 6: Now we will create different content fragments for each doctor. Select your folder and click on Create option then select Content Fragment.

How to Create a Content Fragment in AEM by Mayur Satav

then you will see all the models you created under your CF Model folder here. Select your model and click Next.

How to Create a Content Fragment in AEM by Mayur Satav

Give your content fragment a name, description (optional), and tags (optional). Then select Create.

How to Create a Content Fragment in AEM by Mayur Satav

Step 7: Select your content fragment and edit it. Now you can see all the fields you added during the creation of the CF Model. Now Author all the values and click save.

How to Create a Content Fragment in AEM by Mayur Satav

Repeat Step 6 for other content also and create your content fragments.

How to Create a Content Fragment in AEM by Mayur Satav

Congrats!!! Now you know how to create a content fragment.

If you want to create a separate folder for your content fragment models then follow the below steps.

Step 8: Go to Tools -> General -> Configuration Browser.

How to Create a Content Fragment in AEM by Mayur Satav

Select create option.

How to Create a Content Fragment in AEM by Mayur Satav

Step 9: Give a title to your configuration and check the content fragment models checkbox.

How to Create a Content Fragment in AEM by Mayur Satav

Now your configuration is ready to use, Go to Step 2 and follow the rest of the steps.

Did you like my efforts? If Yes, please follow me to get my latest posts and don’t forget to show your love ❤️ by clapping 👏 for this article and let me know your views 💬 in the comments section.

--

--

Mayur Satav

Hello! welcome to my homepage! My name is Mayur Satav and I am a Senior Developer. I am an accomplished coder and programmer. Visit www.mayursatav.in