views:

39

answers:

3

I was experiencing an odd problem where blocks were not showing up on a site. After a lot of spelunking I have found that block.tpl.php is not getting called/discovered.

Looking at the suggestions that the theme engine is trying to find it looks like the most general template it will look for is block-MODULE.tpl.php - ie if I set up symlinks for block-block.tpl.php, block-views.tpl.php etc then the content will show. It just won't find block.tpl.php

So I can kind of make the problem go away, but I'd feel a lot better if I could fix it properly.

Anyone know why (or where) this would happen?

This is drupal 6, with a zen subtheme. zen is in sites/all/themes/ the subtheme is in sites/example.com/themes/.

(it does seem to be finding page.tpl)

+2  A: 

PHPTemplate will find the more general templates (e.g. block.tpl.php): you can confirm this behavior by looking in the themes/garland folder which has its own block.tpl.php.

The most common reason for the template engine ignoring your template overrides is because the theme registry has not been reset. You can reset it by going to Site Configuration -> Performance and clicking Clear cached data at the bottom of the page.

Also make sure you've gone through and followed the instructions for sub-theming exactly: missing a step can produce unexpected results:

Mark Trapp
I have cleared the theme registry all sorts of times - and enabled auto-rebuild-of-theme-registry-on-every-page-load with no difference.I am pretty sure I have made the subtheme properly - everything works except this - and I can't see what step might cause it to skip 'block.tpl.php' but find 'block-block.tpl.php'
Andrew
A: 

there should be a version of block.tpl.php in both the theme and subtheme directories.

matt ryan
+1  A: 

Turns out I had added a to the hook_theme() function in template.php for blocks that was pointing to a different location and confusing everyone.

Why I did that is lost to history, but it seems to server no useful purpose.

Andrew
It feels real weird answering and accepting my answer like this, but it seems that 'Turns out I did something dumb' is not a reason to Close a question, and I can't delete it? Just 'vote' for it's deletion? Anyhow.
Andrew

related questions