Hi!

For the past week I'm trying to get this feature on my project but I just can't get it right!

I have one view with 2 displays: a page and a GeoJSON feed. Both querying exactly the same fields.
The GeoJSON feed is used by an OpenLayers 3 Map wich block is showed on my view page.
So, I have one page with my results list and my results map.

What I'm trying to do is to filter those results with 2 arguments:
- The first one is a dropdown list of categories. (this is easy with Global filter module)
- The second one is a text input that works like a search term on some other fields.

This last is where my problem is. How can I filter both my results by multiple fields, with onlye one text input?

For example:
If I search for "beach" and category "apartment", both my map and list shoud return nodes with the "apartment" category and where title OR body contains the word "beach".

I'm sure that I can achieve this behaviour using Global Filter module. I just can't get it right. Any idea how to do it?

Comments

csb346 created an issue.

RdeBoer’s picture

Hmmm... this is not what Global Filter was designed for.
Global Filter is for the use case where you filter on one page and then remember that filter on other pages. It's a repeat on multiple pages of the same filter. Not one input two drive two filters.

csb346’s picture

OK RdeBoer... I do understand that. Like I said, I currently have my category filter that does that: One dropbox that filters my "field_category", plus 2 views display (one page and one block) filtered with the use of contextual filters. Just like explain on the readme file.

I just wonder if there is a way to "group" fields on a global filter, or if I can somehow filter more than one field on my views using the same filter (input).

Maybe using PHP on the contextual filter to get the global filter value? I just don't know how.
Or maybe another module suggestion?

RdeBoer’s picture

Not with just a couple of lines of code I don't think.
Not aware of another module.
Sorry.