2

I'm a relative newcomer to Drupal and I'm not sure how to handle this. On this page:

http://staging.stvincentdepaul.net/volunteer

You can see that Volunteer is highlighted in the main nav but so is Today. If you hover over those L1 links, you'll see that each one has a Donate and Volunteer button. These are all part of the main navigation menu in the admin section so each Donate and Volunteer button falls under each L1 link. The Today section was the last to have Donate/Volunteer added so it is attaching the active-trail class to that link since it can only have one.

Is there a way to keep those Donate/Volunteer links in the menu but not part of the active trail?

1 Answer 1

3

This is a common headache. I keep meaning to write a contrib module to address this by letting users define a "canonical" menu item in the event there are several menu items that point to the same page in the same menu.

That said, there are some workarounds you can use.

The best option is to use the Redirect module. You create a redirect to your Donate and Volunteer pages then put the redirects in the menus.

So if your volunteer page is at /volunteer and donate is at /donate, then you can create two redirects. One called /go-volunteer and another called /go-donate which redirect to their respective pages. Then you'd put /go-volunteer and /go-donate in the menu which, when clicked, will take the user to the appropriate page.

Since they're redirects, they won't trigger the active trail.

2
  • Oh wow! That's a great idea, man. Thanks for bringing it up. Commented Oct 24, 2013 at 14:50
  • Hello, I voted up too fast because I must say that Druvision solution doesn't work without this module installed. Because you cannot create menu item with path that do not exist. But I don't want anyway to vote it down. Thanks for the idea, with 2 modules I made it work.
    – anou
    Commented Nov 19, 2013 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.