Skip to content

Instantly share code, notes, and snippets.

@Riaan-ZA
Created June 5, 2012 14:28
Show Gist options
  • Save Riaan-ZA/2875346 to your computer and use it in GitHub Desktop.
Save Riaan-ZA/2875346 to your computer and use it in GitHub Desktop.
Drupal 7: Add <div> around sub menu
function oilcouncil_menu_link(array $variables) {
$element = $variables['element'];
$sub_menu = '';
if ($element['#below']) {
$sub_menu = "<div>".drupal_render($element['#below'])."</div>";
}
$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment