Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Avatar

Level 1
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor
1 Reply

Avatar

Correct answer by
Community Advisor

Avatar

Level 1

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

Avatar

Level 4

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.