Hi There, just wondering if this could be added.

if (module_exists('path')) {
// $alias = drupal_get_path_alias($_GET['q']); // This hits the db via ultimate drupal_lookup_path()
$alias = explode('/', request_uri()); // Might as well save a db hit
$alias = $alias[1];
foreach ($links as $key => $link) {
if ($link['href'] == $alias) {
$links[$key]['attributes']['class'] = 'active';
}
}
return $links;
}

Usually its done through using a method like above in template.php, then applying the theme. But because its a YuiMenu call , the active class doesnt get set to the appropriate menu item.

Thanks,
Cameron

Comments

bakyildiz’s picture

It will be very helpful if you can you give more detail where to add?