Query for Activated pages with specific component | Community
Skip to main content
akhilraj
Level 5
August 31, 2022
Solved

Query for Activated pages with specific component

  • August 31, 2022
  • 2 replies
  • 1934 views

Hi,

We have a requirement to get list of activated pages with specific component in it.

I got the list of pages with that component by running a query, but unable to add the condition whether the page is activated or not.

So I have below query which is giving list of pages having the component.

 

path=/content
1_property=sling:resourceType
1_property.value=abc/components/content/htl/headline
p.limit=-1
orderby=path

 

But I have to accomodate below condition also,

 

2_property=@jcr:content/cq:lastReplicationAction
2_property.value=Activate

 

How We can do it.

 

List of pages with cq:lastReplicationAction = Activate and used headline component in it.

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 Sachin_Arora_

I could get below query closer to your requirement but its does not support finding component to n level. After getting the list of components ,you can write a logic to see if the page is Activated or not.

1_property=jcr:content/cq:lastReplicationAction
1_property.value=Activate
2_property=jcr:content/root/*/sling:resourceType
2_property.value=weretail/components/content/heroimage
path=/content/we-retail
type=cq:Page
p.limit=-1

2 replies

Adobe Employee
August 31, 2022

Hi @akhilraj ,

 

PFB the query. I have verified and this works for me

path=/content
type=cq:Page
1_property.value=Activate
1_property=@jcr:content/cq:lastReplicationAction
2_property=jcr:content/root/container/*/@sling:resourceType
2_property.value=we-retail/components/banner
p.limit=-1

 

Hope this helps

 

Thanks

Sachin_Arora_
Community Advisor
Sachin_Arora_Community AdvisorAccepted solution
Community Advisor
August 31, 2022

I could get below query closer to your requirement but its does not support finding component to n level. After getting the list of components ,you can write a logic to see if the page is Activated or not.

1_property=jcr:content/cq:lastReplicationAction
1_property.value=Activate
2_property=jcr:content/root/*/sling:resourceType
2_property.value=weretail/components/content/heroimage
path=/content/we-retail
type=cq:Page
p.limit=-1