Introduction
Have you ever needed to customize the default Drupal menu <a>
tags? This span
. This will help in case you have big menu items but want to, for example, underline only the word.
Modify your theme
Drupal provides template.php
file under sites/all/[your_theme]/template.php
Add a theme override
1. Edit template.php
<?php
/**
* @file * template.php
*/
function THEME_link($variables) {
return '<a href="' . check_plain(url($variables['path'], $variables['options'])) . '"' . drupal_attributes($variables['options']['attributes') . '><span>' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . '</span></a>';
}
* Make sure you replace THEME with your theme name.
2. Save and clear your theme registry cache.