Hi can any one help me to write a query using query builder to find the componets used in a template. | Community
Skip to main content
Level 2
February 3, 2022
Solved

Hi can any one help me to write a query using query builder to find the componets used in a template.

  • February 3, 2022
  • 3 replies
  • 1374 views
No text available
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 Nitin_laad

@gavya 

If you are looking for any report based on component, you can get it at - below location -

1. http://localhost:4502/mnt/overlay/wcm/core/content/sites/components/details.html/apps/wknd/components/accordion

2. http://localhost:4502/libs/wcm/core/content/sites/components.html

if you are looking for custom query, check below stacktrace

Adobe CQ AEM: query to fetch pages by passing component name - Stack Overflow

 

3 replies

Nitin_laad
Community Advisor
Nitin_laadCommunity AdvisorAccepted solution
Community Advisor
February 3, 2022
gavyaAuthor
Level 2
February 4, 2022

Hi Nitinjl,

 

 Thanks for the message . I have tried the below one which running but no repsults was displaying.

 

My requirement is to get the component  used in a template. Can you help me out.

 

type=cq:Page
path=/content/project/PetcoStore/en_US/espots
1_property=sling:resourceType
1_property=1_property.value=project/components/content/text
2_property=sling:resourceType/apps/project/components
3_property.value=/apps/project/templates/espot
p.limit=50

 

thanks in advance

jetate
Level 4
February 7, 2022

If you want to find a page with a specific component, you can use the following setup in querybuilder.

path=/content/project/PetcoStore/en_US/espots
property=sling:resourceType
property.value=project/components/content/text

 

If you're looking for the templates and not the pages, you would need to search in the appropriate template directory.

path=/conf/project
property=sling:resourceType
property.value=project/components/content/text

 

Looking at the query you posted, you're likely having trouble because you're limiting the type to page which won't have a resource type of a component. You'll need to find the components and then use the crx path to determine the page that contains the component in question.