I hate being such an amateur. Can someone tell me the proper methodology for overriding block.tpl.php? This is what I've done so far:

- Using Drupal 7 with Zen and a starterkit subtheme
- Identified block module and delta using Firebug; block-block-2
- Copied block.tpl.php into my subtheme
- Made a copy and renamed it block-block-2.tpl.php

That's it. The system doesn't recognize it. Was there something else I needed to do? Maybe in template.php?

Thanks to anyone and everyone and sorry for what is probably a dumb question.

Comments

drurian’s picture

Try clearing cache data on the site configuration / Performance page.

ericquigley’s picture

Still not recognizing the override. Might this be a bug in Zen? I find it hard to believe that I would be the first to find a bug this big - I'm usually way late to these parties. Thanks for the reply!

rosborn’s picture

I hope that somebody who really knows what they are talking about chimes in to correct me, but I think that Drupal 7 requires two dashes, so it should be something like block--block-2.tpl.php. However, I haven't got around to overriding templates in my experimentation with Drupal 7 yet.

drurian’s picture

That might be it

occupant’s picture

Close, the template suggestion that was block-block-2.tpl.php is now block--block--2.tpl.php in Drupal 7.

birdonwire’s picture

i tried the '--' instead of '-' but still having the same problem, i think there's some bug in drupal 7

xl883c’s picture

Hi,

I had the same problem as you, and followed the same steps that you outlined.
The file name that finally took for me was:
block--block--2.tpl.php

Good luck!

pasive’s picture

Worked for me using this pattern - block--[module]--[delta].tpl.php

For example to use custom template for main-menu block, your template file name should look like this - block--system--main-menu.tpl.php.

You can get delta using firebug cause for Drupal 7 default block ID contruct is

<div id="block-<?php print $block->module . '-' . $block->delta; ?>" .... ></div>