how to get data from content fragment and export in JSON format | Adobe Higher Education
Skip to main content
Level 2
December 27, 2022
해결됨

how to get data from content fragment and export in JSON format

  • December 27, 2022
  • 3 답변들
  • 11104 조회

Hi Everyone,

This is Kamlesh

I want to get data from content fragment and export in JSON format using sling model exporter, can you please help me figure it out this problem.

Thanks.

 

최고의 답변: aanchal-sikka

Hello @kamlesh-07 

Some OOTB options to explore:

 

Option-1:

OOTB Content Services would allow to access Content Fragment data by appending .model.json to the CF. Reference: https://experienceleague.adobe.com/docs/experience-manager-65/developing/components/json-exporter.html?lang=en

 

It essentially works with Content Fragment component. Example: Add CF to a page via Content Fragment component. Then access its data as http://localhost:4502/content/experience-fragments/wknd/language-masters/en/contributors/stacey-roswells/byline/jcr:content/root/container/contentfragment.model.json 

 

 

Option-2: You should try exploring GraphQL to get Json output from Content Fragments. They are pretty powerful.

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/graphql/multi-step/explore-graphql-api.html?lang=en 

3 답변

Monendra_Singh
Level 3
December 27, 2022
aanchal-sikka
Community Advisor
Community Advisor
December 27, 2022

Hello @kamlesh-07 

Some OOTB options to explore:

 

Option-1:

OOTB Content Services would allow to access Content Fragment data by appending .model.json to the CF. Reference: https://experienceleague.adobe.com/docs/experience-manager-65/developing/components/json-exporter.html?lang=en

 

It essentially works with Content Fragment component. Example: Add CF to a page via Content Fragment component. Then access its data as http://localhost:4502/content/experience-fragments/wknd/language-masters/en/contributors/stacey-roswells/byline/jcr:content/root/container/contentfragment.model.json 

 

 

Option-2: You should try exploring GraphQL to get Json output from Content Fragments. They are pretty powerful.

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/graphql/multi-step/explore-graphql-api.html?lang=en 

Aanchal Sikka