7

So I created a custom menu through the Drupal administration and named it "More Menu." Its machine name, menu-more-menu, was auto-generated by Drupal.

Creating this menu automatically created its corresponding block, and its now available under Blocks administration as More Menu. I then enabled the block and placed it under my desired Region.

I wanted to theme the output of this block. I tried creating a template by following the template suggestion as described here, block--module--delta.tpl.php.

The template file I created was named block--menu--menu-more-menu.tpl.php.

It doesn't seem to work, and I still cannot override it.

Am I missing something?

2 Answers 2

4

For custom menu blocks the format for the block template file name is

block--menu--<menu_machine_name>.tpl.php 

Note: All machine names begin with the 'menu_' prefix and all hyphens are converted to underscores.

1

Just for the heck of it, can you try assigning the actual ID of the block in place of 'menu-more-menu'? So you'd end up with something like block--menu--23.tpl.php. It's just to prove to ourselves that the template system is in fact working and that something is running afoul with the name you're using.

5
  • I tried using its bid, but still not working.
    – Marvzz
    Commented Dec 9, 2011 at 5:12
  • How did you create the template file? Commented Dec 9, 2011 at 5:28
  • I just found out its a known issue. drupal.org/node/1021270 Anyway, what i did is I copied an existing block.tpl.php and renamed it as instructed. I placed on on my appropriate theme folder.
    – Marvzz
    Commented Dec 9, 2011 at 5:33
  • 6
    I got it working though, block template should be: block--menu--menu_more_menu.tpl.php
    – Marvzz
    Commented Dec 9, 2011 at 6:32
  • 1
    Excellent. That's a serious DrupalWTF. Glad it's working. Commented Dec 9, 2011 at 6:34

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.