Hi,

Just installed your module. Added a new menu "Region" and added a few items to it. All works fine, I then copied the menu-block-wrapper-MENUNAME.tpl.php to my theme and changed its name to menu-block-wrapper-Regions.tpl.php, made a few small changes just to test it but none of my changes showed! I then noticed that when I went to admin/build/menu/list and noticed my "Regions" menu has the path menu-regions assigned to it, so I changed the menu-block-wrapper-Regions.tpl.php to menu-block-wrapper-menu-regions.tpl.php but still no luck!

What am I doing wrong?

Comments

dnewkerk’s picture

Tested this with primary links, using the exact file name given in the Help text, and my changes in the template file (after refreshing the theme registry) are not seen. May be a bug.

ludo1960’s picture

Can anyone offer any insight into this problem?

JohnAlbin’s picture

Status: Active » Fixed

Unfortunately, that's a known design flaw/bug in the D6 Theme System.

Read the first paragraph of http://drupal.org/node/190815#template-suggestions carefully.

Suggestions only work when it is placed in the same directory as the base template. In other words, trying to get comment-blog.tpl.php to work, comment.tpl.php also needs to exist inside your theme and in the same directory.

So you'll need a menu-block-wrapper.tpl.php file in your theme as well.

[edit]
Also, I noticed:

I went to admin/build/menu/list and noticed my "Regions" menu has the path menu-regions assigned to it

That means the tpl will need to be called menu-block-wrapper-regions.tpl.php. "regions" is the machine-name of your new menu.

[/edit]

ludo1960’s picture

Thank you very much for taking the time to explain the problem, sorry that it was a known issue, my mistake.
Oh, and thanks for a great module too!

Best Regards...

And consider the page http://drupal.org/node/190815#template-suggestions well and truly bookmarked!!!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

enrique.delgado’s picture

Just a note for D7 users. To get this to work, I had to follow this file name pattern:

menu-block-wrapper--menu-MENUNAME.tpl.php

Using menu-block-wrapper-MENUNAME.tpl.php does not seem to work in D7. Also, remember to also have menu-block-wrapper.tpl.php next to it, and to clear your Drupal cache. If you don't clear the cache (/admin/config/development/performance), D7 won't know to look for menu-block-wrapper--menu-MENUNAME.tpl.php

minorOffense’s picture

To continue with #6, the pattern falls as menu-block-wrapper--MENU_BLOCK_MACHINE_NAME if you define a custom menu in code.

Ex:

/**
 * Implements hook_menu_block_blocks().
 */
function mymodule_menu_block_blocks() {
  return array(
    'my-main' => array(
      'menu_name'   => 'main-menu',
      'parent_mlid' => 0,
      'title_link'  => FALSE,
      'admin_title' => 'My Menu',
      'level'       => 1,
      'follow'      => 0,
      'depth'       => 1,
      'expanded'    => TRUE,
      'sort'        => FALSE,
    ),
  );
}

Means your template needs to be menu-block-wrapper--my-main.tpl.php (NOTthe value of "menu_name" in the definition array, the key of the array itself)