This definitely has been discussed before, and fixed in D6, but can that same solution be applied to the D5 menu system?

Regarding the D6 fix:
http://drupal.org/node/77485

What do you think?

Comments

hansBKK@drupal.org’s picture

+1 PLEASE!

This has been driving me nuts. I've got the same menu listed for both Primary and Secondary, and so far all the methods I've found and tried work OK for primary but not for secondary (work = get class "active" assigned)

Ideally I'd like the path alias to trigger the assignment of the class independently of how the user got there, and the link could be anywhere on the page, not just primary/secondary or even not in the menuing system?

e.g. a page display aliased to /about/facilities/sports would have any menu items anywhere on the page pointing to /about and /about/facilities would get the active class. Seems like something an add-on module similar to menu trails could do

Four Seasons page template uses this:

    foreach($primary_links as $key => $value ) {
      if (ereg('active', $key)) {
        $primary_links[$key]['attributes']['class'] = "active";
      }
    } 

which looks like it could be generalized, but when I tried to apply it to secondary_links I got error messages on the second and subsequent page loads - but not the first??

A systemic solution would be great, but in the meantime I'll keep trying the various options scattered around drupal.org. Otherwise I'll have to hand-code my secondary nav for each section of my site .

Pointers to perhaps obscure but known-reliable solutions would be most welcome.

magico’s picture

(subscribe)

hansBKK@drupal.org’s picture

Update - found a reliable fix overriding theme_links that works with D5 and Zen, but of course this only applies to theme-generated menu links (at least it takes care of primary/secondary menus).

Cleaned-up version in my comment toward the end:

http://drupal.org/node/140491

Still looking for the more functional solution (based on the URL path rather than the menuing path as described above), any help welcome!

dpearcefl’s picture

Status: Active » Closed (won't fix)

Considering the time elapsed between now and the last comment plus the fact that D5 is no longer supported, I am closing this ticket.