I'm stuck with something that seems like it should be simple, so I'm probably just not getting something here. Hopefully it is simple.

I have a block, generated by a view, and I wish to override some of the templates involved. All the views templates are overriding just fine -- but I also wish to override the block.tpl.php template that's wrapping the whole thing.

If I copy block.tpl.php into my theme directory, and modify the file, it correctly modifies all the blocks. However, I can't seem to hit on the proper name for the file to get it to override just the block I want it to.

The block edit link in the blocks admin page is:
http://localhost.dicksb/drupal7/#overlay=admin/structure/block/manage/vi...

From this, I figure the block template should be named:
block--views-features-features.tpl.php

I have tried it with both single and double hyphens after "block". It does not override. (I have flushed the cache.)

I thought I would try a system block, in case it was something going on with Views (though that seemed unlikely):
block--system-powered-by.tpl.php

That didn't work, either.

The theme developer's module doesn't seem to be working yet in D7, so I can't get a list of possible template names that way, either.

Anyone know what I'm doing wrong here? Thanks!

Comments

wrd’s picture

Still not sure what I'm doing wrong here.

Page template suggestions seem to work fine, with both of the following templates being found and used:
page--front.tpl.php
page--node--6.tpl.php

Block suggestions work fine up to the module level, with this template being found and used:
block--menu.tpl.php

But trying to get more specific with the block template, I lose it. With a block generated for a menu named "test" (admin URL: http://localhost.dicksb/drupal7/admin/structure/block/manage/menu/menu-t...), neither of the following templates are picked up:
block--menu--menu-test.tpl.php
block--menu-menu-test.tpl.php

ETA: The suggestions array for this block is:

Array ( [0] => block__footer [1] => block__menu [2] => block__menu__menu-test )

I believe the underscores are meant to be dashes in the filename, correct?

Any help would be appreciated. Thanks!

jjbloomer’s picture

I'm having a similar issue where I'm trying to customize a specific menu title. I created block--menu-menuname.tpl.php and I'm not seeing any results. Any ideas? Thanks.

vitok-dupe’s picture

I think it's a bug, and here i open a bug report.