Hi All,

Some time we need to add HTML tags in Drupal menus but actually it takes as text only, to overcome this we can do below change in sites template.php.

Add the bellow code in template.php,
/**
* This will creates’s HTML output for menu link.
* function YOURTHEMENAME_menu_item_link($link) {
*/
function YOUR_THEME_NAME_menu_item_link($link) {
if (empty($link[‘localized_options’])) {
$link[‘localized_options’] = array();
}
$link[‘localized_options’][‘html’] = true;
return l($link[‘title’], $link[‘href’], $link[‘localized_options’]);
}

Don’t forget to clear the theme cache to see changes.

Advertisements