I'm trying to add a page generated by CiviCRM to my menu. The pages url is 'civicrm/contribute/transact?reset=1&id=6'. I've added the link to the drupal menu manually, and it goes to the page, but that menu item isn't set to active and the active-trail class is not set to it's parent items.

I tried using the full URL and also tried created a module that added a hook_menu function to create a url without query parameters. The hook_menu callback would redirect to the path above.

How can I add that link to my menu, and have the active and active-trail classes set?


2 Answers 2


Ah yes, this has plagued me for years. I cheat and use "Global Redirect Module" https://www.drupal.org/project/globalredirect


There is a way of making menus do whatever you want, including generating the menu link by php code whenever it is being viewed.

The details you can find in the answer below https://drupal.stackexchange.com/a/53531/12153

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.