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

Can we get related page based on its tags

Avatar

Level 3

Hi Team,

 

Hope you are doing great and thank you for supporting all time.

 

Can we get recent three pages based on its tag on current page through code.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Community Advisor

@bhagchand thats the power of communities.

 

have you tried to use AEM querybuilder API? you can use something like below to achieve the results. 

 

Note:- please make sure to have indexes created/used.

 

type=cq:Page
tagid=marketing:interest/product
tagid.property=jcr:content/cq:tags
orderby=@jcr:content/cq:lastModified
orderby.sort=desc
p.limit=3

 

Please refer to AEM documenation for further reference:-

https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/query-builder/quer...

Avatar

Correct answer by
Community Advisor