How Do I Properly Add Custom CSS Classes And IDs To Drupal 7 Sub Menus I'm having a theming problem with my Drupal secondary navigation.  I have a two level menu set up - i.e. five parent links, two of whom have children.  The problem I'm seeing is that the children have the same CSS classes and IDs.  Consequently, when I click on a parent that has children, they are appearing the same as the parents.

I have tried to modify the menu via my template.php and page.tpl.php to no avail.  I have the following in my template.php file and it is throwing errors saying $sub_menu does not exist:

function framework_menu_link(array $variables) {

  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 '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;' . $output . "&lt;/li&gt;\n";
}


Any help or guidance anyone could provide would be appreciated.

Thank you!

+Chris
Have you tried the Menu Attributes module? It's easy to use and has great features:


  The module currently allows you to set the following attributes for
  each menu item:
  
  
  Id
  Name
  Target
  Rel
  Class
  Style
  Accesskey