need clarification in Headless with content fragment implementation | Community
Skip to main content
Level 2
March 27, 2024
Solved

need clarification in Headless with content fragment implementation

  • March 27, 2024
  • 1 reply
  • 488 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kamal_Kishor

@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-fragments/content-fragments-graphql#content-fragments-use-with-aem-graphql-api

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.

1 reply

Kamal_Kishor
Community Advisor
Kamal_KishorCommunity AdvisorAccepted solution
Community Advisor
March 27, 2024

@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-fragments/content-fragments-graphql#content-fragments-use-with-aem-graphql-api

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.