1

I would like to display Views "Exposed filters" fields as a regular table, where the first column would be the field label, and the second column would be the field options/select lists.

So for example from this:

Views, exposed filters

I would like to create this:

Views, exposed filters as tables

What is a possible solution for this?

2

It's easier than I expected.

How-to steps:

  1. Copy views-exposed-form.tpl.php (http://pastebin.com/V77CPxPG) from the Views module's views/theme directory to your own theme's templates directory (but some themes have their template files in their root directory! (or maybe even other directories like theme or sg. else)).
  2. Copy ANOTHER instance of this file to the same directory, BUT now name it so that it also contains the particular view's machine name after two dashes:

    views-exposed-form--page_test_ct.tpl.php  
    

    (like it's explained here; you should give a unique machine name to your view!)
    So in my example, the machine name of the view is page_test_ct, like you can see it here: Machine name of a view

  3. Modify views-exposed-form--page_test_ct.tpl.php like this:
    http://pastebin.com/1qfim7VX
  4. Clear cache (theme registry).

SCREENSHOTS

BEFORE

Views, exposed filters

AFTER

Views, exposed filters as tables

AFTER; having some exposed operators and descriptions too

Views, exposed filters as tables, plus some exposed operators and descriptions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.