Active
Project:
YUI Menu
Version:
5.x-2.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jul 2008 at 13:54 UTC
Updated:
5 Jul 2008 at 15:12 UTC
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
Comment #1
bakyildiz commentedIt will be very helpful if you can you give more detail where to add?