Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

JSON reponse for inherited child page

Avatar

Level 4

I was able to generate page json response with URL-1.json . but issue here is I have a parent page which has left navigation tree  and its inherited across all child pages.
I was able to see tree in the json response when I use parent page. But with the child page I am not able to see  tree in the json reponse .

Any one has any thoughts ?

Thanks

11 Replies

Avatar

Level 4

Hi Hemant,

Thanks for replying and I have tried with what u have suggested, but still  tree doesn't show  in the json response.

Avatar

Level 8

Can you elaborate the requirement ?

Avatar

Level 10

I agree - please describe what are you trying to achieve - do you need the JSON as part of an AEM component?

Avatar

Level 4

I've a iParsys on a page on which a component is there and so that component is inherited on all child pages. When I try to generate the JSON of page on which iParsys is there using selector-extension (-1.json) I get the JSON response that displays component properties which is there on iParsys. But, when I try to generate the json response using same selector-extension for child pages, then it generates the json but doesn't display component properties which is there inside iParsys.

I hope it makes it clear what I'm trying to achieve.

Thanks,
Vijay

Avatar

Level 8

You will not be able to get it directly through page-name.json as the iparsys node is not present under the child page. However if you are trying to get it in sightly through java-script api , then get the parent page json always and get the value or you make a separate call to parent page json always and tweak the logic such that on all child pages of that particular template , you can iterate and get value. or you might have to overlay the iparsys component and customize the creation of iparsys node in child page or you can write a service/servlet that returns the json of a page and check in your logic if the the page has iparsys and has children then add the parent page iparsys json object to child page json. something like that.

Avatar

Level 4

Hi Hemant,

It did work with approach "making a separate call to parent page json always and tweak the logic such that on all child pages of that particular template , you can iterate and get value. " .

Thanks a lot .

It can be marked as correct answer.