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

merlinofchaos’s picture

Status: Active » Fixed

You don't put these files in views/theme -- you put them in your theme directory.

mistresskim’s picture

Status: Fixed » Active

Make 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.

WatermelonMan’s picture

this 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.

WatermelonMan’s picture

Oh, finally it worked.

Sorry, I have to close this topic...

Thanks for your help...

catch’s picture

Status: Active » Closed (works as designed)

Fixed then.

WPanda’s picture

There'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

Tony Sharpe’s picture

Thanks WPanda - #6 did it for me.

zweilicht’s picture

GREAT #6 was also the hint for me!!! this should move into the "views documentation" !!!

tylersclark’s picture

Thanks 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.

eaton’s picture

Also, 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.

andrewsuth’s picture

This issue is really by design?

ericpugh’s picture

I'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?

CHEETAH’s picture

Great advice, tylersclark. Thanks
#6 and #9 work for me

msgreenspike’s picture

#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!

hobo’s picture

I'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..

cerup’s picture

I'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.

timdp’s picture

Same issue as #16. Using Minnelli only. Updated to Drupal 6.15 and views 2.8 and scanning template files hasn't worked since.

th88’s picture

subscribe