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

Desi Raaj’s picture

I'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.

Desi Raaj’s picture

Assigned: Jarviss » Unassigned

will this feature ever make its way to the module in D7? i need to know otherwise I'll have to look for alternative solution.

AtomicTangerine’s picture

Isn'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.

Desi Raaj’s picture

HS = http://drupal.org/project/hierarchical_select

also, i'm willing to chip in a couple of hundred dollars to get this functionality in D7.

Jarviss’s picture

hierarchical_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.

cliffordx’s picture

subscribe

silurius’s picture

subscribe

PSPerkins’s picture

Subscribing

joya’s picture

Subscribing

axgalloway’s picture

So 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".

peterpoe’s picture

Title: Conditional fields in Exposed filters for views integration needed » Conditional Exposed filters for Views
Project: Conditional Fields » Views (for Drupal 7)
Component: Compatibility w/ other modules » exposed filters

This 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.

axgalloway’s picture

I 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.

axgalloway’s picture

Status: Active » Needs review

Whoa, saw this just now, this might be the solution:

http://drupal.org/project/views_dependent_filters

dawehner’s picture

Category: task » support
Status: Needs review » Fixed

Okay nice, joachim writes good modules, so this should be fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kwsubha’s picture

Use Reference field option limit module for conditional Exposed Filter in drupal 7.

mas0h’s picture

Issue summary: View changes

Unfortunately Reference field option limit doesn't support search_api with views.

silurius’s picture

What about Views Dependent Filters?

Edit: Oops, missed axgalloway's comment (#13).

pablofun’s picture