Expose content as json - Multiple resourceType | Community
Skip to main content
AEMLearner-1989
Level 4
October 11, 2022
Solved

Expose content as json - Multiple resourceType

  • October 11, 2022
  • 3 replies
  • 967 views

I have a use-case where I want to use expose a JSON(Multiple resource types). 

 

/content/wknd/poc/jcr:content/root/container/imaewithtext.json .its exposing only parent content not child components(Text and Image)

 

<div class="imagewithtext">

<div data-sly-resource="${'image' @9556322='wknd/components/text'}"/>

<div data-sly-resource="${'image' @9556322='wknd/components/image'}"/>

</div>

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 Lokesh_Vajrala

Hi @aemlearner-1989, you can use .model.json instead of .json to export the content if the Sling Models use the Sling Model Exporter framework. 

3 replies

Lokesh_Vajrala
Community Advisor
Lokesh_VajralaCommunity AdvisorAccepted solution
Community Advisor
October 11, 2022

Hi @aemlearner-1989, you can use .model.json instead of .json to export the content if the Sling Models use the Sling Model Exporter framework. 

manjunathdj
October 11, 2022
AEMLearner-1989
Level 4
October 12, 2022

I got the solution. Model.json is won't work here instead you can give infinity.json so that iterate all the child nodes of parent. 

 

And also you can write a custom logic like resource.listchildren and iterate the node as per your need.