When using Views Filter Selective with taxonomy terms, it's great that I only see the terms that have been actually used. However, when I click on a term in the exposed filter, all the other terms disappear. It's not such a good UX if the user has to click All (or Any) to see the other terms again.
Sorry if this is a duplicate, but I didn't find a request like mine.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | views_hacks-show_all_selective_terms-1721644-12.patch | 782 bytes | undertext |
| #1 | views_hacks-show_all_selective_terms-1721644-1.patch | 771 bytes | papagrande |
Comments
Comment #1
papagrandeI rolled a patch to change just one line so that the view that builds the exposed filter uses 'all' as its own filter instead of the exposed filter of the parent view. Simple, but it does what I need.
Comment #2
srgk commentedthat's really helping, thanks!
can you please give me an idea on how to remove initial filtering on the selective filter when the view is loaded with some contextual filter? because the selective filter then is limited to the results corresponding to the contextual filter, while i want initially a complete selective list, which now shows only when i remove the initial contextual filter with the exposed filter checkbox (i have them synced).
thanks to your patch, if i later select some filters, the selective list stays complete.
Comment #3
srgk commentedi created a feature request http://drupal.org/node/1732806
Comment #4
Macronomicus commentedCheers... patch in #1did the trick.
Comment #5
jpstrikesback commentedThanks PapaGrande, working here! This is actually addressing buggy behaviour as when you have multiple exposed filters and one returns a validation error the selective filter returns no results and shows the default state of "Actual values...", this allows other filters to have errors without killing the selective filter. Good to commit IMO.
Comment #6
jpstrikesback commentedQuick update:
In further testing (on new views which didn't have the options cached in the
static $result) I found that the initial value for the option should be set to 'All' as well as the set_exposed_input performed in the patch above:becomes:
Comment #7
Jawni commentedHey guys
Is there a chance I can use this functionality in only one of the exposed filters? Can't seem to figure it out, here
I basically have two filters: Category and Color
I want Category to allways display ALL the available values at all times
But then when you choose a Color, the values displayed are only the ones available at that level
Not sure if I made it clear. Any help?
Comment #8
papagrande@Jawni, you likely could put in a hack that applies the selective filter for only certain exposed filters, but the better long term solution for the community would be to add in a toggle in the Exposed Filters modal that allows you to activate the selective filter per exposed filter, possibly similar to what Better Exposed Filters does.
Comment #9
gjones commentedWhen I applied the patch in post #1, I'm stuck with only one result for my selective exposed filter. The first option of the filter is always shown as the only result even when it shouldn't.
Comment #10
reatcory commented#1 worked for me
Comment #11
Mark Vincent Verallo commentedIn case you only want to be selective to certain criteria/filter, just copy the value of those criteria/filter to another variable and set the others to 'All'. Then pass that copy to $view_copy->set_exposed_input(). For example:
Hope this will help others..
Comment #12
undertext commentedJust putting patch for alpha2 version.
Comment #13
subeda commentedHi!
I have a problem similar to @Jawni. I have a web of comics. With three exposed filters: category, genre and author (taxonomy terms).
Selective Filters works great so when one of the exposed filters is selected the other only shows the avalaible options for the selected filter.
1. My problem is that the selected exposed filter doesn't show the full list anymore. I tried the patch but it applies to all exposed filters so always the three filters show all options.
What I'm trying without success is:
If for example I choose in Category: Adventure
The filters genre and author only shows the avalaible options for that selection (that's currently how selected filters area working great).
But if I try to select other from the same exposed filter, Category, only: -any- and the current selection are shown. I need that the current filter who All options.
2. Also I'm trying that if I make a selection in an exposed filter any other exposed filter are reset it's values. Do you know how to do this with Views Hacks or other module.
I'm trying to avoid: no results.
Thanks!
Comment #14
david_garcia commentedPlease, help review this SandBox module:
https://drupal.org/sandbox/david_garcia_garcia/2162097
So we can decide if it can properly replace current module.
Thank you.
Comment #15
infojunkieThis module has been deprecated in favour of https://drupal.org/project/views_selective_filters. Please test there and reopen if necessary.
Comment #16
colbtron commentedWhich file do you edit? Thanks.