Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using Drupal 6.4 with views 6.x-2.0-rc3.
I'm trying to theme the views I've created.
I'm creating templates (e.g. views-view--san-bio-view.tpl.php, for a view called san-bio) and putting them in the views/theme folder, as suggested in tutorials.
However, after I'm pressing the "rescan template files", nothing changes (if found, the new templates should be shown in bold, but this doesn't happen). And the templates aren't actually applied.
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedYou don't put these files in views/theme -- you put them in your theme directory.
Comment #2
mistresskim CreditAttribution: mistresskim commentedMake sure your template file is called views-view--san-bio.tpl.php NOT views-view--san-bio-view.tpl.php if the name of your view is san-bio. Also, I think the template is supposed to go in your site's theme folder not the Views theme folder. At least that's what works for me.
Comment #3
WatermelonMan CreditAttribution: WatermelonMan commentedthis name - views-view--san-bio-view.tpl.php is actually one of the names suggested by the Views module itself.
so I don't think it's wrong.
concerning putting files in my theme directory (not views/theme) I've tried it earlier and it didn't work for me, however I'll try again and tell you the result.
thanks for your responses.
Comment #4
WatermelonMan CreditAttribution: WatermelonMan commentedOh, finally it worked.
Sorry, I have to close this topic...
Thanks for your help...
Comment #5
catchFixed then.
Comment #6
WPanda CreditAttribution: WPanda commentedThere's one important thing - if your administration theme is different from the one you're trying to customize, then the common way doesn't work (at least, it didn't work for me). I was putting the customized template into the theme's directory, but the 'Theme information' didn't show the proper file in bold (neither did Drupal see it). However, after I've put the customized file into both themes' directories (including the theme which was set as administration one at that time) it finally worked!
Eventually I've changed the administration theme to be the same as the production one, and after that everything started to behave normally. So my advice is - if you have tried everything and the thing still doesn't work - make sure that the theme you're trying to customize and your administration theme are the same.
BR, WPanda
Comment #7
Tony Sharpe CreditAttribution: Tony Sharpe commentedThanks WPanda - #6 did it for me.
Comment #8
zweilicht CreditAttribution: zweilicht commentedGREAT #6 was also the hint for me!!! this should move into the "views documentation" !!!
Comment #9
tylersclark CreditAttribution: tylersclark commentedThanks for highlighting this. Besides duplicating the views across themes, you can add the views from the user-facing theme's 'views' folder to the admin-facing theme's folder through a symlink, so you don't have to update them in two places.
Comment #10
eaton CreditAttribution: eaton commentedAlso, if your user and admin themes are (relatively) similar, you can make one a child theme of the other. Then it will inherit its parent's templates.
Comment #11
andrewsuth CreditAttribution: andrewsuth commentedThis issue is really by design?
Comment #12
ericpughI'm using Garland as an administration theme and zen as the default theme. Adding the "views" directory and templates to both themes fixed the scanning problem (the correct templates are now in bold under the view's theme information,) however, these templates are still not affecting the output of the zen theme. Are others still having issues with this?
Comment #13
CHEETAH CreditAttribution: CHEETAH commentedGreat advice, tylersclark. Thanks
#6 and #9 work for me
Comment #14
msgreenspike CreditAttribution: msgreenspike commented#12, I am having a similar problem. Although the rescan recognizes the new template file, it is definitely not getting called. I'm running 6.x-2.6. If you find a fix, please post it!
Comment #15
hobo CreditAttribution: hobo commentedI'm seeing a similar problem as 14. I have an admin theme= garland and theme=zen.
I tried setting the admin theme to zen..
i put the template file into both zen and garland.. when you go to edit the view it loads from garland though on the site it still renders from zen..
The problem i'm seeing is that i'm theming a field output.. if i override $output and make it say 'hello' instead of the normal field output.. it appends it below each 'row' of views output. (also the $output is always empty instead of having content from the field')
The odd thing is that i have this exact thing working on another view..
Comment #16
cerup CreditAttribution: cerup commentedI'm receiving the same issue without a sub theme.
I only have one theme enabled and it's in sites/all/themes. I have my custom .tpl.php in theme_name/views/ ( i like to put it in a subfolder for organization). I have also tried putting it directly in the theme root and it still won't scan. I've been able to scan 2 other templates successfully, but it stopped working now.
I've tried clearing site and views cache. Any thoughts?
update:
The display style, row style, and style output all seem to work for me, but it can't find any of the field based ones when I rescan.
Comment #17
timdp CreditAttribution: timdp commentedSame issue as #16. Using Minnelli only. Updated to Drupal 6.15 and views 2.8 and scanning template files hasn't worked since.
Comment #18
th88 CreditAttribution: th88 commentedsubscribe