Perhaps I'm implementing it incorrectly, but I am following the Menu_Block guide based off this page: http://drupal.org/node/748022

An example of what I'm trying to do is override theme_menu_item for Menu Blocks. Here's an example of the code I'm implementing.

function mytheme_menu_item__menu_block($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
  if (!empty($extra_class)) {
    $class .= ' '. $extra_class;
  }
  if ($in_active_trail) {
    $class .= ' active-trail';
  }
  return '<li class="'. $class .'">'. $link . $menu ."</li>\n";
}

But I can't get ANY of the API calls within Menu_Block to trigger. Not exactly sure what the deal is.

I posted in the theme development forum and I got suggestions to post this in here.

Comments

JohnAlbin’s picture

Status: Active » Postponed (maintainer needs more info)

If I implement this in mytheme's template.php:

/**
 * Generate the HTML output for a menu item and submenu.
 *
 * @ingroup themeable
 */
function austin_menu_item__menu_block($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
  if (!empty($extra_class)) {
    $class .= ' '. $extra_class;
  }
  if ($in_active_trail) {
    $class .= ' active-trail';
  }
  return '<li class="'. $class .'">'. $link . $menu .", hi!</li>\n"; // Hello, world.
}

After clearing the cache, it works fine. The ", hi!" is appended to all the menu items, but only for menu items in menu blocks.

But I can't get ANY of the API calls within Menu_Block to trigger.

I'm not sure what you mean.

Dave Reid’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No response in four years, closing.