I've recently updated Radix in our distribution (from a very out of date version), and the theming of menus has changes. I've fixed up our navbar (it used a custom ctools content type), however, now any instances of main_menu that we have added as panels panes no longer have dropdowns.

How can I enable other menu instances to be rendered with dropdown classes?

I've tried the below in menu.inc, but did not affect my menu panes.

function theme_preprocess_menu_link(&$variables) {
  // Assuming the menu you want to have dropdows has the name "menu_with_dropdowns"
  if ($variables['element']['#original_link']['menu_name'] == 'main_menu') {
    $variables['theme_hook_suggestion'] = 'menu_link__dropdown';
  }
}

Comments

PI_Ron created an issue. See original summary.

PI_Ron’s picture

I had the menu name value incorrect in my code.

ie. 'main-menu' instead of 'main_menu'.

All fixed :-)

function theme_preprocess_menu_link(&$variables) {
  // Assuming the menu you want to have dropdows has the name "menu_with_dropdowns"
  if ($variables['element']['#original_link']['menu_name'] == 'main-menu') {
    $variables['theme_hook_suggestion'] = 'menu_link__dropdown';
  }
}
PI_Ron’s picture

Issue summary: View changes
PI_Ron’s picture

Status: Active » Fixed

Closed resolved.

Status: Fixed » Closed (fixed)

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