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.
Did you by design limit the use of menu--block.tpl.php to system menus? It can be easily expanded to all defined menus.
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedAt the moment its applied to all Menu module blocks and the 4 generated menus
'navigation', 'main-menu', 'management', 'user-menu'
, seehtml5_boilerplate_preprocess_block()
.Comment #2
dcrocks CreditAttribution: dcrocks commentedSorry, still don't understand about system building theme_suggestions. I had used:
if (in_array($vars['block']->delta, array_keys(menu_get_menus()))) {
$vars['theme_hook_suggestions'][] = 'block__menu';
but that is unnecessary and more overhead.
Comment #3
Jeff Burnz CreditAttribution: Jeff Burnz commentedHmmm, probably needs benchmarking as to which is faster, they way I have done it using menu_get_menus(), maybe this information is available with less overhead, I am not a menu system expert by any means. Will need to investigate, definitely an approach, clearly in D8 we need to fix this.