Views Selective Exposed Filters is a great module. I've attached a patch that attempts to make a couple improvements. It uses the Views GROUP BY clause to return the distinct filter options in a single query. This eliminates the need for a two queries and makes the result set much smaller. It also uses COUNT to return the number of results for each filter option. This allows for an added option of appending the count to the end of each filter label (similar to faceted filters). I've tested a handful of D6/Views 3 use cases, but it could definitely use some further inspection.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eric constantinides’s picture

FileSize
354.54 KB
194.86 KB
350.7 KB

Thank you for your efforts! I just tried this out and it definitely helped some. As it turns out, however, the patch didn't "reset" itself properly. Here's my situation:

My goal is to have this view on my client's shoe site (http://paoloshoes.com/style/mens-shoes/casual) be able have a pager. It is not paged right now and when I do page it (without your patch) and choose a color option not on the literal page I'm on (but in the view), I get the error "An illegal choice has been detected. Please contact the site administrator".

Your patch fixes that. But after being at a specific color and then choosing "Any" to basically go back to the start, the available colors in the color selection drop-down list show only 5 colors - instead of the 14 colors which should be shown.

So without delving too much into your code, is there a way to "Reset" the filters?

I have attached consecutive screenshots of my staging site so you can see what I mean.

Thanks so much! I really hope you can help me out.

denser’s picture

Hello.

Sorry for my English.
A few days trying to make the filter, but nothing happens. I count the number of nodes, but exposed filer do not remove the unwanted filter, from list, as on your site!

Tell me please! How when you select a filter, then remove the other (unsuitable)?

Could you please upload the full text of the module or send me an email. Please!

infojunkie’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

This module is no longer maintained for D6 and has been deprecated in favour of https://drupal.org/project/views_selective_filters for D7. Please test there and reopen if necessary.