To see this, add this to garland's template.php and add the user-menu block to a region:

function garland_menu_tree__user_menu(&$vars) {
  dpr('user menu'); // this does not print!
  return theme_menu_tree($vars);
}
function garland_menu_tree__management(&$vars) {
  dpr('management menu'); // this does print!
  return theme_menu_tree($vars);
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Needs review
FileSize
684 bytes

Nice and simple patch.

Though is there an API function for converting - to _ for theme functions?

sun’s picture

Status: Needs review » Needs work
+++ includes/menu.inc	23 Aug 2010 13:04:27 -0000
@@ -961,7 +961,7 @@ function menu_tree_output($tree) {
+    $build['#theme_wrappers'][] = 'menu_tree__' . str_replace('-', '_', $data['link']['menu_name']);

We should use strtr() here, as that is much faster on short strings + small replacements.

Powered by Dreditor.

joachim’s picture

Status: Needs work » Needs review
FileSize
679 bytes

Thanks for the review! :)

Here's another patch using that instead.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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

markabur’s picture

Please see followup issue with theme_menu_link(): #1001146: Cannot theme links in a menu when menu_name contains a hyphen.