0

I think I'm going to have to make a custom operator for this, but I figured I might as well ask in case I'm missing something obvious.

Let's say I have (in D7) three nodes tagged with colours:

Node 1

  • blue
  • green

Node 2

  • yellow
  • red

Node 3

  • blue
  • red

Node 4

  • blue

The user selects red, blue, and green from the exposed filter in a view. This view should return Node 1, Node 3, and Node 4, but not Node 2 (as it is tagged with yellow). Using the "has taxonomy term" filter, the operators "is all of" and "is one of" don't work here, as the first one returns nothing, and the second returns Node 2.

To make things even more complex, I'll need to do this with two different filters in the view (with different sets of taxonomy terms), as well as have a standard "is one of" filter on a third taxonomy term set.

Am I missing a simple solution with this, or do I need to write a custom operator/filter? Thanks!

0

So if I understand this correctly, you only want the nodes that have all the checked values (and not a subset). So if I checked only blue, only node 4 will be returned and not 1 and 3?

I think you'd be best of to write a custom filter, based on the 'is one of' filter. With that you can select nodes that have the terms attached and than drill down the filter.

  • Thanks, this ended up being the right call. I based it off of the "is none of" filter, and just did an array subtract of selected tids from all tids in the vocabulary. – Lott Apr 12 '17 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.