Hi
Im trying to learn how to manipulate the html output of the main menu on the page.
- I have made a fresh install of drupal 7.23
- made a copy of the stark theme, renamed it to t1 and placed it in the site/all/theme folder
- added the theme as my default them in drupal
- created a simple page called 'About page'
So now I have on my page:
Main menu
Home About page
Id really would like to add fx.|| around the links, so it looked like this |Home||About page| or alter the
and
tag in others way I would see fit.
As I understand the api I need to create a template.php file an ad a hook?
- So I created an empty template.php file in the t1 theme folder an added the following code:
function t1_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 '|
|' . $output . $sub_menu . "
\n";
}
But the only place that change happens is in the adminstration submenu.
I have tried a gazillon other options of the function and also tried creating it in a page.tlp.php file, but no matter what nothing tuches the mani menu 'items'/ links.