0

I bought a Drupal 7 premium theme and thus my menus use the theme's default menu class.

How do I remove this class from one of the menus so that it would be a simple HTML list or use the native Drupal menu class?

1 Answer 1

2

You can remove all unwanted classes and add your own classes using the code below, Its for a rough idea, use dpm or any debugger to locate exact tool

function THEME_menu_link(array $variables) {
  //unset all the classes
  unset($variables['element']['#attributes']['class']);

  $element = $variables['element'];

  if($variables['element']['#attributes'])

  $sub_menu = '';


  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
4
  • Hello, What is DPM? Can't gen a clear answer from Wiki. I didn't understand what I should do. Can you please simplify the answer a bit?
    – user16289
    Commented Nov 26, 2015 at 17:06
  • 2
    When you install devel module you can use dpm($variable) and it will show you the array in a very beautiful format. Follow along the above code.
    – Shabir A.
    Commented Nov 26, 2015 at 17:08
  • @benos dpm is a function that comes with de devel module ;-) Commented Nov 26, 2015 at 17:08
  • Haven't really worked with these yet, thank you guys,
    – user16289
    Commented Nov 26, 2015 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.