You are here

Edit menu link in Drupal 7

For eddintg the menu links in Drupal 7, use your theme template.php file.

Add a custom function that alows you to edit all the menu link items.



function themename_menu_link(array $variables) {

$element = $variables['element'];

$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']) . '>xc' . $output . $sub_menu . "</li>\n";

}

The above function will allow you to add extra elements inside the li element of the menu links.

Note : Remember to change the name of the function, themename will be replaced by your themename.

Website fix request form

If you have problems with the website based on Drupal or WordPress, please feel free to contact us: