Drupal - Overriding views-view-fields.tpl.php

For views 3 - make sure that under "Format->show" field is selected "Fields" (NOT content)

Than go to views and find "Theme: Information" there you can see list of all template currently used (BOLD) and candidate template files. Find witch tpl.php file you want to use.

Go to views module directory and under "theme" folder you should be able to find base tpl.php for your chosen file. Copy that file in your theme folder. Rename it on naming convention given in Theme:Information.

Rescan template files. If everything is OK views-view-fields.tpl.php should not be bolded anymore. Bolded should be your newly created tpl.php then you can style new tpl.php file as you like.


The order of precedence for the naming convention of the tpl files is from broadest to narrowest in it's scope. Thus the field override for all views is one combination, but you can't change the order, as you have tried, only go more specific. To achieve what you want, the view object is available in the tpl you have created so it is possible to have an if(){} else{} statement in there to filter the views that need the override by inspecting the name/display of the view.

Tags:

Views

Theming