Expand my Community achievements bar.

SOLVED

AEM Package Filter

Avatar

Level 3

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.

 

ChaoXiong_1-1661224402184.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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....

 

View solution in original post

5 Replies

Avatar

Community Advisor

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

for eg. something like this:

ManuMathew1994_0-1661226642212.png

Hope this helps.

 

 

 

Avatar

Level 3

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.

Avatar

Level 3

ChaoXiong_1-1661227451010.png

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.

Avatar

Correct answer by
Community Advisor

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....