I've encountered an incompatibility between Menu Trail by Path and Migrate (see http://drupal.org/node/1794236#comment-6690614 ). One solution could be to specific paths (wildcarded?) that Menu Trail by Path won't attempt to set active trail on.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SeriousMatters’s picture

Status: Active » Postponed (maintainer needs more info)

Menu Trail By Path only changes the output of menus. I don't understand how it can affect routing.

Moreover, Management Menu is already avoided.

cyborg_572’s picture

While I'm not sure about the migrate conflict, I have had this module incorrectly activate menu items when using modules like Menu Firstchild, where there's a sibling menu item with the same path as a parent menu item, and the sibling gets active instead of the current item.

Aside from basic conflicts, I also feel it would be a useful feature to be able to limit the scope of this module a bit so that in can be used in addition to modules like Menu position, when the path doesn't always match the menu structure.

I'd also be willing to work on implementing this feature, with a UI similar to what blocks uses for paths, if you'd be interested in including it.

cyborg_572’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
2.66 KB

It turns out that the site I was looking at was not actually using Menu Firstchild; The menu structure was just weird. #1781718: Parent path with same depth conflict. fixes that issue nicely, but I still thought this feature would be useful, so I've created a patch anyway.

This adds a control to the admin form for this module, with similar functionality to what blocks uses for determining pages.

cyborg_572’s picture

I'm adding a re-roll of the patch against the current stable version, in case anyone finds that more useful.

Robin_K’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Used #4 with the latest version (7.x-2.0), works like a charm.

I also used this option to disable the menu trails on admin pages.

Thanks!

jp.stacey’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.55 KB

Nice work to cyborg_572: the patch in #4 solves the overall problem brilliantly; however, with verbose PHP errors switched on, I get the following warning notice:

Notice: Undefined variable: title in menu_trail_by_path_form() (line 154 of .../sites/all/modules/menu_trail_by_path/menu_trail_by_path.module).

This is because that line of the patch references what I think is a nonexistent $title variable at that point.

I've rerolled the patch with suitable text in place of that variable and attached it to the issue now.

cosolom’s picture

May be a good idea make a submodule for Context as actions? Then menu trails can be activate or deactivate on different conditions.

jp.stacey’s picture

(Patch in 6 re-rolled for -p0 patching, as I think that's what Drush make 5.x requires.)

davy-r’s picture

I trying to keep the configuration for this module as simple as possible. While this is a powerful configuration option, it's not that easy to understand for novice users. You can use the hook_menu_trail_by_path_parent_candidates_alter() to accomplish what you want.

I'm thinking about a simplified version, something like:
"Active on admin paths" - if checked, this module will also be active on the administrative section of the site.

davy-r’s picture

Version: 7.x-2.0 » 7.x-3.x-dev

"Active on admin paths" configuration option is implemented, see http://cgit.drupalcode.org/menu_trail_by_path/commit/?h=7.x-3.x&id=9fb68...