Is there a way to all pages information under a folder? | Community
Skip to main content
GK-007
Level 9
May 8, 2018
Solved

Is there a way to all pages information under a folder?

  • May 8, 2018
  • 2 replies
  • 1436 views

Hi All,

I want to get all the page's information(in all nested folders) in json format under site root folder(/content/www/us/en).

Thanks,

Kishore.

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 aanchal-sikka

Sling now provides Resource Filter API. It can be used to filter information in a tree. Please refer to:

https://www.youtube.com/watch?v=nBu4m-pgZuA 

https://kiransg.com/tag/resourcefilterstream/

 

 

2 replies

arunpatidar
Community Advisor
Community Advisor
May 8, 2018

You can achieve this by Query debugger Tool as suggested by Scott
http://localhost:4502/libs/cq/search/content/querydebug.html

Query

type=nt:base

path:/content/AEM63App/en

property:jcr:title

property.operation : exists

p.hits=selective

p.nodedepth

p.properties=jcr:path jcr:title

p.limit : 21

you can modify above query based on your search criteria.

Please refer for more info Query Builder API - docs.adobe.com 

when you execute this you will be getting an option to get Json query via JSON QueryBuilder Link, when you hit this link you'll get the results like below:

{

   "success":true,

   "results":21,

   "total":21,

   "more":false,

   "offset":0,

   "hits":[

      {

         "jcr:path":"/content/AEM63App/en/travel/jcr:content",

         "jcr:title":"Travel"

      },

      {

         "jcr:path":"/content/AEM63App/en/community/jcr:content",

         "jcr:title":"Our Community"

      },

...

]

you can parse this Json and use wherever you want.

hope this will help.

Thanks

Arun

Arun Patidar
aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
December 27, 2023

Sling now provides Resource Filter API. It can be used to filter information in a tree. Please refer to:

https://www.youtube.com/watch?v=nBu4m-pgZuA 

https://kiransg.com/tag/resourcefilterstream/

 

 

Aanchal Sikka