Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
JohnAlbinIf I implement this in mytheme's template.php:
After clearing the cache, it works fine. The ", hi!" is appended to all the menu items, but only for menu items in menu blocks.
I'm not sure what you mean.
Comment #2
Dave ReidNo response in four years, closing.