Theming $fields output of views

When you want to theme the fields output of a view here is what you need to do:

 print $fields['my_field_name']->content; 

That was the short answer. Now you are maybe wondering where you would  put that line of code?
In the views configuration go to advanced>theme>information. Here you see a summary of all the templates views has allready and the naming conventions of possible custom templates.
Pick one from the fields examples and make a new tpl file with that name.

Now the fun starts, in this tpl you can go crazy with your own html. On every spot you want the views content to be output you print the line of code from the short answer.

Add new comment