I have the Sitemap module installed and it creates an unordered list of my chosen menu's items.
Main Menu looks like this:
Home - submenuitem1 - submenuitem2 - submenuitemn
Services - submenuitem1 - submenuitem2 - submenuitemn
References - submenuitem1 - submenuitem2 - submenuitemn
Links - submenuitem1 - submenuitem2 - submenuitemn
How can I add DIVs to each main menu item with its subitems ( Home+subemenuitems, Service+submenuitems etc.) ?
I managed to override site_map_menu_link to give it some depth at least.
function MYTHEME_site_map_menu_link(array $variables) {
$element = $variables['element'];
$sub_menu = '';
$element['#attributes']['class'][] = 'menu-' . $element['#original_link']['plid'];
$menu_id = 'menu-' . $element['#original_link']['plid'];
$link_depth = 'depth-'. $element['#original_link']['depth'];
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '<div class="'.$menu_id." ".$link_depth.'"><li>' . $output . $sub_menu . "</li>\n</div>";
}