Hi all and thanks for the great work on this.

I'm currently looking for a way to have 2 exposed filters, but instead of working as combined, I want the one to cancel the other.
For example I have one filter called "brand" and a filter called "category".

I would like the brand filter to select all the nodes regardless of category, and the same for the category field.

Is this possible?

A way I used to do this, is by creating the exposed filters, hiding them and creating 2 separate views for the brand and the category that bring in the taxonomy terms. I'm rewriting the term links so for example they are like:

xxxxx?field_brands_tid=All&field_category_tid=11

and

xxxxx?field_brands_tid=25&field_category_tid=All

Then I bring these views into my main filter view. It works, but i consider it as a hack (for example there are problems with translation, I cannot mark a selected option to have an active class and so on).

Anyone with a better solution?
Thanks

Comments

mikeker’s picture

Status: Active » Postponed (maintainer needs more info)

I'm writing this without having tried this at all... Views filters work as either AND or OR filters -- meaning their either subtract from, or add to, the existing result. In your case you want one filter to eliminate the other (though what happens when both "category" and "brand" are specified?).

Anyhow, the first thing I would try would be exposed forms as blocks. You'll need two displays of the same view with each having the exposed-form-as-block option checked. One would have a filter with just "category" and the other would have a filter with just "brand." On the page, you'll need to stack the two exposed filter block next to each other and you'll have duplicate "Submit" buttons, but you may be able to handle that in the theme layer.

I'd be interested to know how you solve this issue. Please report back if you do!

mikeker’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Issue queue cleanup... Closing since there has been no activity in the last month.