I need to add 'Active' to the <li> tag of the Active link. At the moment this just appears in the <a> tag. In menu.inc this appears to be handled by:
function theme_menu_local_task($link, $active = FALSE) {
return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n";
}
Is there a way to add this to your menu?
Many thanks
Comments
Comment #1
yokell commentedComment #2
yokell commentedThis seems to work. Is this the best way of doing this?
Comment #3
xurizaemonI implemented a similar fix, but did it by overriding the theme_links() function. The code I added was:
And the resulting mytheme_links() function was,
If yokell's version works, though, it seems a lot cleaner :)
Comment #4
yrocq commentedComment #5
yrocq commentedI added an 'active-trail' class to 'li' tags for active menu items, like standard Drupal menus.
Comment #7
cruzinxxx commentedCould you tell me exactly how you implemented the function.