I have 3 different views page displays that each have a set of exposed filters for users to filter content. Each set of filters is unique except for one: 'region.' which, when populated, returns results based on proximity. All of my filter options are marked 'Remember last selection.'
My problem is, I would like to place a select field on all pages (as separate functionality from the exposed filters forms) of the site that when populated act as the default values for all exposed region filters.
Now, unfortunately, because I had to create separate unique page displays, one value does not persist across all pages, and the viewer has to fill out the region each time. I would like something that works like this:
1) on page load, check exposed filter value
2) is it set? no?
3) set value with global filter value
4) if someone sets a filter value before the global value, then update global value and all other exposed filter values
Is there a way to do this with views? I don't mind writing a module, but don't have the first clue where best to get started. Any direction would be appreciated.
Thanks!
Comments
Comment #1
Gastonia commentedI found the structure to access the value in views I am looking to change. As I said above, the number of pages could be dynamic, and each page has a unique set of exposed filters except one postal_code, so I created a flexible loop to test each Views display for the array I am looking for and set it's value:
Views uses the above session structure to to save data when 'remember' is selected for exposed filters. At first I tried to set the value itself, and that didn't work. I then tried to set the SESSION itself, and that didn't work.
How do I get my modules to set these values if they are empty? I am simply lost at this point. Any help is appreciated. Thanks!
Comment #2
rdeboerViews Global Filter, maybe?
Comment #3
damiankloip commentedNo reply, and I think RdeBoer is right in #2, Views Global Filter will probably resolve your issue.
Comment #4
Gastonia commentedAh, that worked great. thanks for pointing out the module.
Comment #5.0
(not verified) commentedincomplete sentence