Skip to content

Instantly share code, notes, and snippets.

@sanguis
Created January 16, 2012 16:30
Show Gist options
  • Save sanguis/1621647 to your computer and use it in GitHub Desktop.
Save sanguis/1621647 to your computer and use it in GitHub Desktop.
drupal 7 menu link with unquid #id funnction
<?php
function theme_menu_link($variables) {
$element = $variables['element'];
//changes
$element['#attributes']['id'] = 'mlink-' . $element['#original_link']['mlid'];
// standard output;
$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";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment