how to retrieve content fragment data
How to Implement a backend API or service to fetch content fragments from the CMS
How to Implement a backend API or service to fetch content fragments from the CMS
Hi @ssin93 ,
There are two ways through which you can achieve this:
1. Use AEM’s GraphQL APIs for Content Fragments which supports headless CMS scenarios wherein external client applications render experiences using content managed in AEM.
Checkout this article for more details on it:
https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/graphql/overview.html?lang=en
2. Write your custom servlet which will invoke a service class that in turn will return the JSON data from Content fragment.
3. Make your content fragment adaptable through sling model and use exporter in it.
I'd recommend you to go for the first AEM Graph QL.
Thanks
Tarun
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.