CaaS for a page content in aem | Community
Skip to main content
karansheel
Level 3
September 17, 2018

CaaS for a page content in aem

  • September 17, 2018
  • 3 replies
  • 4771 views

Is there any way to display content of a  page like a sling model json. For example : if i have a page "/content/my-site/homepage" & it contains three components a,b,c . Each component has a sling model. if i hit the component path("/content/my-site/homepage/jcr:content/a.model.json") directly with .model.json extension then it will give a json view of that component as i'm using jackson exporter in sling model. i want to display the json of all the components when i hit the page with any extension. like if i hit "/content/my-site/homepage.model.json" then it will give combined json of all the three components .There is a option to use infinity.json but t gives node structure as a json not a sling model & i don't want to use content fragments or i have  to develop a custom solution for this (using servlet and invoke it on the basis of selctor).

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

3 replies

smacdonald2008
Level 10
September 17, 2018

I have never tried this use case - i have asked some other internal ppl to look here.

Daniel_Gordon
Adobe Employee
Adobe Employee
September 17, 2018

With the latest version of the Content Services feature pack hitting: "/content/my-site/homepage.model.json" as you described should give you a combined JSON of the Page + any components that have been added to the page. Are you not seeing this behavior? Or are you trying to do something else?

karansheel
Level 3
September 17, 2018

I tried it on AEM6.4 but didn't get expected rrsult. Can you please provide the latest package version

edubey
Level 10
September 17, 2018

model is the selector used by page model sling exporter.

When you have custom implementation of component sling exporter, you have  to give the path to component in repository and then use model.json on it