How to search and get list of all pages of a given template in AEM?
Adobe experience manager is a powerful content management tool that provides ample options to explore and manage the content. In this post, we are going to see how to search and get all the pages from AEM which are created using a given template.
The detail required to execute this process.
Project path: Path of the directory where we would want to search the pages. e.g. /content/sample/en/en_us
Template path: Path of template. e.g. /apps/sample/templates/press
Now we have prerequisite handy with us, let's move to the execution.
Step 1: Go to the below mention URL. Adjust the domain according to your domain name.
Step 2: Put the following query in the "Query Builder Debugger" section
In the above query; type cq:Page will include the nodes that have type cq:Page. Other than that nodes will get excluded from the script. after that path under that, we want to search the pages. Then after the name of the property and property value that will be a path of the template for which we are looking.