Posted by paloczp on September 23, 2008 at 10:24pm
Jump to:
| Project: | Node breadcrumb |
| Version: | 5.x-2.0-rc2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
It's possible to add "active" class to the selected menuitem?
Like
<ul class="menu">
<li class="active leaf odd"><a href="sport" title="Sport">Sport</a></li>
<li class="leaf even"><a href="fashion" title="Fashion">Fashion</a></li>
</ul>Thx, Paul
Comments
#1
Hi,
this feature would be very nice for me too.
So i did a little patch on my drupal-system:
File: node_breadcrumb.module
Function: _node_breadcrumb_set_location
After the last line "menu_set_location($location);"
Add:
// PATCH - set menu activefor ($i = (sizeof($location)-1); $i >= 0; $i--) {
print_r ($location[$i]);
$menu_item = menu_get_item(NULL, $location[$i]['path']);
print_r($menu_item);
if ($menu_item['type'] != 118) {
continue;
}
menu_set_active_item($location[$i]['path']);
break;
}
At my case it works good, maybe it helps someone else.
#2
Hm, not too perfect!
When I use this, lost the "tabs primary" (Preview | Edit etc.)
Thx, Paul
#3
Look at menu_trails module for code to do this -- it has to go in your theme.