2

I am a Views newbie. I added a template file to my sub-theme folder with a more specific name (from Theme Information), the file name becomes highlighted, but the file is not used (I'm sure of this cuz I wrote some new lines to the template (<li>Like, Doah!</li>, etc.).

Some extra details:

  • I am using fusion core with a fusion sub-theme (begot from fusion_starter). The fusion sub-theme is activated. I've not changed much.
  • The custom view is fully created, has a menu entry, and displays an end user content page with the correct data.
  • I currently have only two "views-view-*" template files between the directories containing the two fusion themes.
    • fusion_core/views-view--page.tpl.php (edits to this page ARE visible on the end user "content" page).
    • fusion_my_subtheme/views-view--my-view--default.tpl.php (the trouble file)
      1. Click Theme: Information to find "views-view--my-view--default.tpl.php" is listed as the most specific file name available under Display output.
      2. Theme Information highlights this template file name bold. And, when I renamed this file, the Theme Information display returned an error message that the file is missing--therefore I conclude the Drupal/Views app is finding this file.

Why, if this file name is highlighted, is this more specific template file located in my sub-theme directory not being used by Drupal? Is it possible there is an order to cache clearing, or template refresh? I feel as though I'm trying to catch my tail... :/

If the file name is highlighted, changes are made to that custom file named, then Views Module and Drupal should render the page with changes made to this template--that's "How it works", yes?

Xtian

  • @kiamlaluno: Thanks. I guess. While your edit does format the code to greater readability, this code is irrelevant to the problem of theme template specificity. (>_<) – xtian Jun 5 '11 at 22:39
  • I rewrote the question without the PHP snip... – xtian Jun 7 '11 at 16:59
  • Has anyone come up with a solution to this? I am struggling to override the default tpl.php files in theming information. I have copied the name correctly from the list of more specific file names, placed a file of that name in the theme folder under /modules/views but still no success after clearing all caches, and rescanning. – user1971 Jul 13 '11 at 12:57
  • Has anyone come up with a solution to this? I am struggling to override the default tpl.php files in theming information. I have copied the name correctly from the list of more specific file names, placed a file of that name in the theme folder under /modules/views but still no success after clearing all caches, and rescanning. – user1971 Jul 13 '11 at 12:58
  • The answer above does solve the problem. Try it. – xtian Jul 14 '11 at 12:17
2

This is rather strange. The fact that the correct file name is highlighted in the Views theming information section suggests it's set up correctly. However, I'll add some more things to check and see where we end up.

You should also have the views-view--page.tpl.php file in your sub-theme's folder. Strictly speaking, anytime you are overriding a template file with a more specific template file, the default template file should reside in the same directory. So just copy views-view--page.tpl.php to your fusion_my_subtheme/ folder. Then clear your theme registry[1] and try again.

I would also suggest using the Devel Themer module to help figure this out. It will tell you for sure which template file is being used for the View's display.

  1. I usually choose to clear ALL caches instead of just the theme registry. Occasionally I've seen strange problems disappear when I do this.

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.