The same functionality needed for Views (Drupal 7), when we choose one exposed filter field, another filter field will or not be displayed in condition to the settings we can manage. The same module for exposed filters in views.
Can you advise a solution or module (links, piece of code for views), how to make conditional fields in views to filter content: if I choose 1 category filter field, the other fields are displayed like type, location, color, manufacturer. In other case when I choose 2 category - different are displayed like male/female, year, ...
Comments
Comment #1
Desi Raaj commentedI'm very much interested in this too, as of right now the only way to do this is to use jquery to show/hide fields based on conditions, but this wouldn't work in my situation as I will be adding more fields on daily basis and plus i'm not a coder. Any non-coding help could be really appreciated.......I tried HS module but it is still too buggy to use in D7, also I like the way this module works better then HS.
Comment #2
Desi Raaj commentedwill this feature ever make its way to the module in D7? i need to know otherwise I'll have to look for alternative solution.
Comment #3
AtomicTangerine commentedIsn't this already possible by limiting which fields are available in the exposed filter? For example, I have content types of Form A, Form B, Page, Article, Webform, etc, and an exposed filter of Content: Type. When I set up the filter, there's an option to "Limit list to selected items" to check, then I can restrict the content types to Form A and Form B. It's still an exposed filter, but is limited.
@ Desi Raaj: what is the HS module? I'm terrible with acronyms and curious what you're referring to.
Comment #4
Desi Raaj commentedHS = http://drupal.org/project/hierarchical_select
also, i'm willing to chip in a couple of hundred dollars to get this functionality in D7.
Comment #5
Jarviss commentedhierarchical_select doesn't fit. Example: Exposed filter in view with fields which are not terms of taxonomy, they are text lists. First I choose Category (taxonomy term field) than I should see other fields which depend on the previous choice of taxonomy term, than I choose year, color ... If I choose another term I should see other fields to filter like model, brand ... and this fields are not subterms of Category taxonomy. Lots of fields to filter in one view which are displayed only when certain taxonomy term is chosen. Filter fields are not taxonomy terms.
Comment #6
cliffordx commentedsubscribe
Comment #7
silurius commentedsubscribe
Comment #8
PSPerkins commentedSubscribing
Comment #9
joya commentedSubscribing
Comment #10
axgalloway commentedSo this feature would add a layer of filtering to the exposed filters right?
For instance, say I am filtering by content type, with the choices of Monkey, Gorilla, and Chimpanzee.
When Monkey is selected, three other filters appear: favorite fruit, type of monkey business, and tail length
When Gorilla is selected, two filters appear: favorite fruit, level of gorilla strength
When Chimpanzee is selected, four filters appear: favorite fruit, tail length, mischievieousness level, and favorite hat
I guess typically the way I have worked around this issue is by creating new multiple view panes in panels and then displaying the view pane in the panel if it passes some condition. It works for specific cases of small sets of filtering levels, but large sets I imagine wouldn't be as easy, like more than ten content types in the example, and also doesn't solve non-automically selected filters. That sounds confusing, but I bet someone might understand it, haha.
Wouldn't this be an issue for the Views coders to do?
Just a sidenote irrelevant to the issue, I just began using conditional fields today. I want it to do the following, hopefully it does, it will allow one of three fields to be filled in when a radio button is selected on another field. Then, in views, I do not display the empty two fields, so only the third filled out field can be seen, basically, I just select "Hide empty fields".
Comment #11
peterpoe commentedThis would be a new module with very little code to share with Conditional Fields.
Moving the request to the Views project, maybe with a larger audience it will be easier to pick up some dev time to make it happen.
Comment #12
axgalloway commentedI don't know enough about the structure of the Views code to write it myself, but, I think this would be simple enough by adding some sort of if statement function where if it equals some value for one of the filters, display exposed filters X, Y, Z. Maybe some hierarchy could be established. I mean it already allows for AND and OR, adding an IF feature would maybe do it.
Another way to do it, I definitely don't know how it could be done, but building a Filter content type and integrating it into views.
Comment #13
axgalloway commentedWhoa, saw this just now, this might be the solution:
http://drupal.org/project/views_dependent_filters
Comment #14
dawehnerOkay nice, joachim writes good modules, so this should be fixed.
Comment #16
kwsubha commentedUse Reference field option limit module for conditional Exposed Filter in drupal 7.
Comment #17
mas0h commentedUnfortunately Reference field option limit doesn't support search_api with views.
Comment #18
silurius commentedWhat about Views Dependent Filters?
Edit: Oops, missed axgalloway's comment (#13).
Comment #19
pablofun commentedhttps://drupal.org/project/views_dependent_filters