Closed (fixed)
Project:
Omega
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Jun 2011 at 20:43 UTC
Updated:
29 Aug 2011 at 06:22 UTC
I have a problem theming the links of main menu. I was using Fusion and i added span tags to main menu tags with this function.
function yourtheme_menu_link(array $variables) {
$element = $variables['element'];
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
$element['#localized_options']['html'] = TRUE;
$linktext = '<span class="your_class">' . $element['#title'] . '</span>';
$output = l($linktext, $element['#href'], $element['#localized_options']);
return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
Now i am trying to use it with omega and doesnt do nothing. I put the function at the template.php file and cashe but nothing at all.
Am i missing something about omega theme?
Does anybody no how i can do it
Thank yoy very much.
Comments
Comment #1
damiandab commentedthe same problem :(
Comment #2
apmsooner commentedThis code here will add the span tag... perhaps you can build on it:
Comment #3
apmsooner commentedActually in doing some research, that function in the original post works just fine if you're using the menu as a block. If you have it set in the theme settings however to render on page, its a different function so... simple solution is just disable the theme menu and use the block and you're good to go :)
...and you may just want to target the main menu block in which case you would specify it in the code like so:
Comment #4
fubhy commentedGlad that you worked it out yourself.