I need a way of setting up dependent exposed filters, so for example a user chooses to rent an item based on term (say, by the month or year) from a drop down list. The 2nd, dependent filter is a price range. The DB has two columns for price - one by the month and the other by the year, and so searches and displays one column or the other depending on the choice of term. There doesn't seem to be any direct way of doing this, but it seems this would be a very common use case and therefore just begging for a module or plug-in to Views.

This can probably be done though rather crudely with arguments with perhaps a page change in between filter selections but I think it would be really ugly. AJAX might make it slightly less ugly. The filters would be in a side block.

A cursory Google search turned up only this (http://drupal.org/node/190949), a relevant discussion and partial solution in D5.

Thank you,

Bruce.

Comments

druplicate’s picture

Thinking about this some more, the other thread I referenced is not what I need. It's really a duplication of the Hierarchical Select module it seems to me, which is apparently near release for its support of content taxonomy and content taxonomy Views filters.

See: http://drupal.org/node/342991 and http://drupal.org/node/342992

To be a bit more succinct:

I need a filter selection process that just displays a different column in a DB table based on the drop down selection. At the moment it seems the only way to solve that problem is to use some conditional logic in the template.php file, or in the tpl.php file. Normal Views filters just select a record if it has or does not have a corresponding filter element, but unless I'm a total idiot and missing something, there's no simple provision for displaying or not displaying certain columns based on a filter selection.

Another common use (and one I have to solve too) is display different currencies in a Views filter depending on the selected currency in a Views filter drop down. Putting hundreds of different countries in the theming layer is of course possible but a pain in the neck and not especially flexible. This gets even more complicated since what I really want is to take a single value of currency from the DB and convert it on the fly (based on the drop down currency selection) using a 3rd party service like Yahoo finance. I have to see if the Money API module can do this.

Bilmar’s picture

subscribing

merlinofchaos’s picture

Status: Active » Closed (duplicate)