I used Theme Developer module to find the candidate name for a block that I'm using and it gives me this candidate name: block__menu_block__1 But it doesn't take action when I name as block--menu-block-1.tpl.php . I've tried several other variations to no avail, and I have cleared my cache. What would I name this block?

2 Answers 2


Checkout the template suggestions: http://drupal.org/node/1089656

It should be: block--menu-block--1.tpl.php


When translating from a suggestion to a template filename, Drupal replaces every underscore with an hyphen; in this case, "block__menu_block__1" becomes "block--menu-block-−1.tpl.php" (there is a hyphen more than you used).

The code that converts underscores in hyphens is in drupal_find_theme_templates().

if (!isset($info['base hook']) && !empty($pattern)) {
  // Transform _ in pattern to - to match file naming scheme
  // for the purposes of searching.
  $pattern = strtr($pattern, '_', '-');
  // …

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.