CVS edit link for mikeker
I wish to contribute a new module to drupal.org. This module, Better Exposed Filters, provides an easy way to use checkboxes or radio buttons for exposed Views filters. This is a common request in the
support forums, the
Views issue queue and a
Views 3.0 feature request. However, there is no satisfactory solution.
When this module is enabled, each exposed filter is given a "Display exposed filter as" option allow the user to select the default (select box) or a checkbox/radio button option. Checkboxes or radio buttons, depending on the "force single" setting, replace the standard single/multi-select box.
The module in its current form passes the Coder code review checklist with only two minor warnings.
Thank you for your time and consideration.
- Mike
Comments
Comment #1
mikeker commentedAttaching the module.
Comment #2
mikeker commentedSorry, just realized I'm not supposed to change the Tags field...
Comment #3
avpadernoThere is a module that has the same purpose: http://drupal.org/project/views_filter_pack.
Comment #4
mikeker commentedIt has a similar purpose to VFP, however it takes a completely different approach to solving the problem (theming vs. rewriting SQL). I have entered bugs against VFP, but there hasn't been any work on that project in the last three months. In addition, VFP generates incorrect SQL.
I understand that the CVS application guidelines discourage duplication and that it is preferred to fix similar existing modules than to creating new ones. However, because VFP takes such a vastly different approach patching or co-maintaining that module is not an option.
I don't believe this is a case of "Module 'Foo' is just too complex so I have written a much simpler version." That guidance is written from the perspective of the UI. The difference between VFP and this module is in the code. With all due respect to Peter Boeren, VFP's author, his solution -- to rewrite the already-complicated SQL from Views -- is fraught with peril. I believe allowing the theme layer to handle this problem is a more sustainable and simple solution.
Thank you for your consideration
- Mike
Comment #5
avpadernoThanks for the reply.
The difference between the modules seems very important, IMO. Altering the way the page is themed is the better solution, in this case. I agree that altering the SQL query made from Views is not required, when the purpose is simply to alter a form field.
Comment #6
merlinofchaos commentedI agree with Kiam. A different methodology is generally an acceptable grounds for duplication.
Comment #7
mikeker commentedThis one properly handles exposed taxonomy filters. Let me know if you'd prefer this as a patch to the original upload...
Thanks.
- Mike
Comment #8
DanielJohnston commentedSubscribing, apologies for comment spam. FWIW, I agree that this module seems like a more elegant and stable solution to exposing a checkbox filter in Views.
Comment #9
avpadernoI apologize if I didn't approved before this application.
@mikeker: Welcome on board!
Comment #10
DanielJohnston commentedQuick question: I've installed the module in #7 and created a view with an exposed filter selecting on node type. Can't find the "Display exposed filter as" setting anywhere in the view edit screen. Don't know if I've hit a bug, if there's something deliberately missing in this version, or if I'm just looking in the wrong place. Displaying as node teasers rather than fields, and I'm on Views 2.6. Happy to post an export of the view in question or a screenshot if that's any help. Can also hold back until after publishing and post as an issue then if you'd prefer.
Comment #11
DanielJohnston commentedOops. Didn't mean to change status!
Comment #12
mikeker commentedDanielJohnston@10: Glad to see folks are already using this! Node type is already formatted as a set of checkboxes so I don't expose the "Display exposed filter as" option.
Now that I've got CVS access (thanks KiamLaLuno!) I'll post this as a project. If you still feel node type should have the display options presented we should discuss it there.
Thanks.
- Mike
Comment #15
mikeker commentedNot sure why the 'bot replaced a tag that had been removed... Removing it again.