YUI Menu doesnt highlight the selected menu item as per normal primary menus

cameronp - July 5, 2008 - 13:54
Project:YUI Menu
Version:5.x-2.4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

drupalhizmetleri - July 5, 2008 - 15:12

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

 
 

Drupal is a registered trademark of Dries Buytaert.