Is it possible to create a list component that evaluates multiple paths and tags? | Community
Skip to main content
james-mke
Level 3
October 20, 2020
Solved

Is it possible to create a list component that evaluates multiple paths and tags?

  • October 20, 2020
  • 2 replies
  • 1101 views

We have received a development request to build a component that evaluates assets in the following way:

 

DAM path A OR DAM path B

AND

Tags X, Y, AND Z

 

So that whenever the tags are found on an asset in either of the path locations, the asset will appear in the list.

Is it possible to have a list component behave in this way?

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 Shashi_Mulugu

Yes @james-mke we can create a component with the said requirements.

 

Basically its an and condition between tags field and path field(which has or condition in between)

 

Can be achieved using query builder.

2 replies

Shashi_Mulugu
Community Advisor
Shashi_MuluguCommunity AdvisorAccepted solution
Community Advisor
October 20, 2020

Yes @james-mke we can create a component with the said requirements.

 

Basically its an and condition between tags field and path field(which has or condition in between)

 

Can be achieved using query builder.

Manjunath_K
Level 7
October 20, 2020

Hi @james-mke 

We can fetch the matching asset using Query Builder as mentioned below (example where Product A asset is tagged with product id "product-1331" , Product B is tagged with product id "product-1221" & both assets are under different root path). you can change OR & AND condition between tags based on your requirement.

 

Query Builder Result :

 

Query :

property=cq:tags
property.1_value=test:product-1331
property.2_value=test:product-1221
property.or=true
group.1_path=/content/dam/test
group.2_path=/content/dam/images
group.p.or=true

 

 

Hope this helps!