Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

provide list of pages with their assosciated tag

Avatar

Level 8

Hi All,

I want to get a list of pages and their tags under "/content/masters" whose tag value is atlas-copco:industrial-tools/expert-hub/industries/industrial_assembly

for example:

page path  : /content/masters/en                            

cq:tag: atlas-copco:industrial-tools/expert-                                    hub/industries/industrial_assembly, atlas-copco:industrial-tools/webinars

 

I have used this query

SELECT * FROM [cq:PageContent] AS page
WHERE ISDESCENDANTNODE([/content/masters])
AND page.[cq:tags] = 'atlas-copco:industrial-tools/expert-hub/industries/industrial_assembly'

It just gives result with page path.

 

Can anyone provide the query.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

If I have understood your requirement correctly, you can use the query builder to obtain paths and their associated tags as shown below. 

path = /content/masters/en
type = cq:Page
tagid = atlas-copco:industrial-tools/expert-hub/industries/industrial_assembly
tagid.property = jcr:content/cq:tags
p.hits = selective
p.properties = jcr:path jcr:content/cq:tags
p.limit = -1

 

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

If I have understood your requirement correctly, you can use the query builder to obtain paths and their associated tags as shown below. 

path = /content/masters/en
type = cq:Page
tagid = atlas-copco:industrial-tools/expert-hub/industries/industrial_assembly
tagid.property = jcr:content/cq:tags
p.hits = selective
p.properties = jcr:path jcr:content/cq:tags
p.limit = -1

 

 

Avatar

Level 8

@Mahedi_Sabuj I ran the query but the tag associated to it isn't displaying only page path is showing
For air-motors page it has 4 tags I want to get those tags as well with page path

 

Vani1012_0-1699263604713.png

Please refer screenshot How I want

Vani1012_1-1699263798759.png

 

 

Avatar

Community Advisor

Hi @Vani1012,

Navigate to the lower-left section and locate the "JSON QueryBuilder Link". Click on this link to access a list of page paths along with their associated tags.

Screenshot 2023-11-06 at 4.12.35 PM.png