Active
Project:
Special menu items
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2011 at 16:24 UTC
Updated:
30 Nov 2011 at 16:24 UTC
Hi,
i'm using theme_menu_link to add a div around a submenu list in my template.php and it's working fine. But if enable special_menu_items, it seem that my theme_menu_link is not used anymore.
if think this function is the fault:
function special_menu_items_menu_link(array $variables) {
// Find special menu link
if (in_array($variables['element']['#href'], array('<nolink>', '<separator>'))) {
$element = $variables['element'];
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
switch ($element['#href']) {
case '<nolink>':
$tag = variable_get('special_menu_items_nolink_tag', '<span>');
$title = strip_tags(l($element['#title'], $element['#href'], $element['#localized_options']));
$css = NULL;
// Set a class if the link is in the active trail.
if (!empty($element['#original_link']['in_active_trail'])) {
$css = 'active-trail';
}
$output = special_menu_items_render_menu_item($tag, $title, $css);
$element['#attributes']['class'][] = 'nolink';
break;
case '<separator>':
$output = variable_get('special_menu_items_separator_value', '<hr>');
$element['#attributes']['class'][] = 'separator';
break;
}
return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}
// Call the original theme function for normal menu link.
return theme('menu_link_default',$variables);
}
Is there a way for that special_menu_items still pass the links in my template function ?