2

I need to customize the markup for certain fields in my view. In D6/Views 2 This was possible using the templates specified in Views admin under "Theme information," "Row style output." In D7/Views 3, however, these templates in Theme information come up as .tpl.php, --news.tpl.php, --default.tpl.php, --default.tpl.php, --block.tpl.php, --news--block.tpl.php and adding those templates does not change anything.

I had found an old issue on drupal.org from a previous version, which had been necro'ed to cover this, but I can't find it now. Is this broken, or am I missing something?

3

In the leftmost column, Format > Show needs to be changed from Content to Fields. Hat tip to https://drupal.stackexchange.com/a/5413/4371

| improve this answer | |
2

You have to be sure where to add the templates depending on your theme, then clear the caches for your templates to be recognized by the system.

Also, the names you indicate should be more precise, with view and display names. If it's not the case, something is broken on your installation.

| improve this answer | |
  • Have you seen the correct behavior in Views 3.1? This problem occured on a fresh install. – yitznewton Feb 13 '12 at 11:38
  • This is an example of thme information for the row style of a glossary view called 'bookmarks' : views-view-fields.tpl.php, views-view-fields--glossaire-bookmarks.tpl.php, views-view-fields--default.tpl.php, views-view-fields--default.tpl.php, views-view-fields--page.tpl.php, views-view-fields--glossaire-bookmarks--page.tpl.php – Countzero Feb 13 '12 at 14:49
  • I'm familiar with what it should look like from my experience with Views 2. What I want to confirm explicitly is that someone has seen this correct behavior in Views 3, because my completely clean install of D7.12 and Views 3.1 is showing the broken template names. – yitznewton Feb 13 '12 at 14:52
  • The ouput above comes from views 3, not 3.1. Did you install latest Ctools dev along Views ? A check to the issue queue may be useful here. – Countzero Feb 13 '12 at 15:02

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.