Sunday, December 18, 2022

Adobe aem Headless || Content Fragment & Model in adobe aem

As you know adobe aem in the best cms for content management, we can use adobe experience manager as headless cms. Here are the three most important concepts below that you should know before using adobe aem as headless. 

 

Adobe aem content management


  • content fragments model in adobe aem

    The structure of the content we intend to develop and manage in aem is specified in the content modal for aem.
    The type of input we will utilize for a particular set of data is defined in the aem content model.
    After developing an aem content model, we can simply make changes to the model later if we need to.
    For instance, we can add a text input field, a number input field, a date, a multi-input field, a content reference, a fragment reference, etc.



  • content fragments in adobe aem

    We create, update, read, and delete our content, and after we create it, we can use it wherever we want.


GraphQL and Rest API in adobe aem

 With the help of GraphQL, we can request to read or access the content. With the help of rest API, we can update or create a content fragment. 
 
 
 

How to create Content Fragment modal in Adobe aem

  1. Go to Tools -> Assets -> Content Fragment Model



 
2. Select your project folder.

Adobe aem content management

if(your project folder is not appear in content fragment model then)
   {
       Goto Tools ->Configuration Browser
Adobe aem content management

Select Project Folder -> Properties

 Adobe aem content management 
 
 check content fragment modal -> save &close

so now again go to Tools -> Assets -> Content Fragment Model your project folder will be visible
}

3. Click on create button  -> add details in popup  -> create
Adobe aem content management

Now You can check "Country Content Model Created Successfully"

Adobe aem content management

 
 

How to Add input fields in Content Fragment Model

 
1. Hover on created content fragment model and then click on the "pencil icon"
 
Adobe aem content management

2. Here you can drag and drop required fields from the "Data type" tab to the left side 
3. add properties of you filed inside properties filed.
Adobe aem content management


4. if you need to add multi data then u can select multifield  from the first drop-down inside the properties

5. then click the save button
Adobe aem content management
 

6. so we have added [Name, Famous] two fields in our content fragment model, you can add them according to Your requirement



So, Finlay we have created and added input fields in the content fragment model in aem


 
 
 
 

How to Create Content Fragments

  • goto Navigation > Assets > Files


  •  Click on create button to create a folder  > enter your folder name ( As I already have created a "Country Folder")


  • goto inside your folder > click create button > content fragment > select your model
if {
If you did not find your model here then go back and check your folder > properties > policies tab > byPath and select your model >  save & close




}

  • Now go inside your folder and create a content fragment and select your model now
  • add the title of your content fragment > create > open and add your data, ( you also can manage variations by clicking on the variation button ) > save

  • go to your folder now you will see the content fragment added








Finally, we have created a content fragment model and content fragment 
 


Thanks
Previous Post
Next Post

post written by:

0 comments: