Warning message

Documentation is currently being migrated into the new system. Some pages might be temporarily missing, and some guides might appear empty. Thank you for your patience while we are improving Drupal.org documentation.

Using PHP to Rewrite Views 3 Output

Last updated on
December 1, 2016 - 17:52

In your view edit page, go to Advanced -> Other -> Theme: Information.
Its dialog will expose all the theme files that are called for your view.

You can use generic to very detailed theme files that will only be use for your views display.

The first file name in Display output is views-view.tpl.php. That will apply to all views and displays.
The next one in the list is views-view--[view name].tpl.php. It will only apply to your view.
It keeps drilling down until it gets as specific as possible.
views-view--[view name]--default.tpl.php is the last one in the list and only applies to the default display of the view.

Clicking the Display output: link will expose the template code that views uses.
Simply copy and create a new template file with one of the suggested in the list.
It's usually best to be as specific as possible.
The template file can go anywhere in your theme
and views will pick it up as long as you rescan template files in the theming information and save the view.
There are view templates, row templates, field templates and field specific templates.

Orginal Post http://drupal.stackexchange.com/questions/935/views-3-and-html5-how-to-o...