Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Query for Activated pages with specific component

Avatar

Level 6

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Employee Advisor

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

Avatar

Correct answer by
Community Advisor

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