AEM Package Filter | Community
Skip to main content
ChaoXiong
Level 2
August 23, 2022
Solved

AEM Package Filter

  • August 23, 2022
  • 3 replies
  • 1525 views

I want to package page packets ending in "-shorts". How do I write a filter?

I tried the following method, but it didn't work.

 

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_

In case you are using ACS Commons, you can achieve it by using Query Packager.

SQL2 Query for same would be 

SELECT * FROM [cq:Page] AS page WHERE ISDESCENDANTNODE(page, "/content/we-retail/us/en/products") AND name() like "%shorts%"

Link : https://adobe-consulting-services.github.io/acs-aem-commons/features/packagers/query-packager/index.html

 

3 replies

Manu_Mathew_
Community Advisor
Community Advisor
August 23, 2022

@chaoxiong You can use the "Add rule" and choose "inlcude" from the dropdown and add your filter-

for eg. something like this:

Hope this helps.

 

 

 

ChaoXiong
ChaoXiongAuthor
Level 2
August 23, 2022

thanks, @manu_mathew_ 

I mean, when you don't know the specific directory, you only see the directory level and how to get all the pages ending in "-shorts". You can only get the pages under "men/shorts" by writing like this.

ChaoXiong
ChaoXiongAuthor
Level 2
August 23, 2022

I'm trying to write like this. Although I can get all the pages ending in "-shorts", I don't want to include these extra pages in the picture.

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

In case you are using ACS Commons, you can achieve it by using Query Packager.

SQL2 Query for same would be 

SELECT * FROM [cq:Page] AS page WHERE ISDESCENDANTNODE(page, "/content/we-retail/us/en/products") AND name() like "%shorts%"

Link : https://adobe-consulting-services.github.io/acs-aem-commons/features/packagers/query-packager/index.html

 

ChaoXiong
ChaoXiongAuthor
Level 2
August 23, 2022

Thank you very much @sachin_arora_, that's great!😊