Hi,
How do I change an exposed views filter in Drupal 6 to checkboxes instead of the default multi select?
Thanks,
Hi,
How do I change an exposed views filter in Drupal 6 to checkboxes instead of the default multi select?
Thanks,
The exposed filters are standard Drupal forms, so you can get to them before rendering via hook_form_alter()
or hook_form_FORM_ID_alter()
. The only tricky part is that they all seem to use the same form id 'views_exposed_filter'
(IIRC), so you need to check for some additional hints to decide if you hooked into the right form.
Once there, you can modify the form element array in question as you like, e.g. changing the type from '#select' to '#checkboxes' (don't forget to adjust the default values and options to match your new type).
how to adjust the default values and options to match new type. The option in select is very different from options in checkboxes.
Anyone can help?