Hello All,
To highlight a menu item (normal menu) as active when in certain conditions
i want to add a (css) class to the link in question. I tried setting the
menu item as active using menu_set_active_item, but this breaks the local
tasks menu. I tried doing the same using menu_set_item preceded
by menu_local_tasks(0), again this breaks the local tasks. So it seems i
have to add a css class to my menu item. I tried this using the following
hooks, but to no avail:
function my_module_menu_link_alter(&$item, $menu) {
if($item['link_path'] == 'evaluator/mijn-projecten/personal') {
$item['options']['alter'] = TRUE;
$item['options']['attributes']['class'] =
(($item['options']['attributes']['class'])?' ':'') . "active-trail";
}
}
function my_module_translated_menu_link_alter(&$item, $map) {
$item['localized_options']['attributes']['class'] .= ' active-trail';
}
Any ideas?
Best,
Toon