Expand my Community achievements bar.

need clarification in Headless with content fragment implementation

Avatar

Level 2

Hi All

 I have a few doubts about headless with content fragment . Could you please clarify anyone  ..

1. Why is it often recommended that headless implementations rely solely on content fragments?
What advantages do content fragments offer in comparison to other content structures?
2. Is it feasible to use custom JSON structures instead of content fragments for headless implementations? What are the limitations or drawbacks of using alternative JSON formats?"
3. To implement a headless architecture effectively, is it necessary for the AEM application to exclusively utilize content fragments?

 

Thanks

1 Reply

Avatar

Level 8

@KannanCh2 :
With content fragments, 

  • We can create structured content which is not intended for any specific pages. We do not have to create complex components to author the required fields/content.

  • We can use GraphQL API with CF, with this, we can query the content from CF only which is required instead of getting the entire content of page/component.

If your use-case is to to build only headless content in AEM, it would be easier to create CF model(s) instead of building complex components and exposing the content of them via an exporter. This use-case can be easily solved using CF with GraphQL APIs.

Please refer this adobe documentation for more information: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/assets/content-f...

If you have to create pages in AEM as well as expose some of content from pages to a headless application, in that case you can create components (with rendering scripts htl) and using sling model expose data as JSON.

thanks.