Closed (fixed)
Project:
Menu Trail By Path
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2014 at 17:48 UTC
Updated:
1 Aug 2016 at 20:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lee20 commentedAttached is a patch which adds a call to drupal_alter in _menu_trail_by_path_get_parent_candidates()
Comment #2
a.milkovskyGood idea. You should also provide hook_menu_trail_by_path_parent_candidates_alter() documentation in menu_trail_by_path.api.php file.
P.S. I would also provide a setting or hook to menus, which should work with menu_trail_by_path. but it's other issue.
Comment #3
a.milkovskySee the patch.
Comment #4
a.milkovskySee the patch.
Comment #5
fagoMakes a lot of sense. Not sure about the naming/docs though - what does it mean to alter parent candidates? Does it change parents?
Comment #6
a.milkovskyYep, for me name "parent candidates" is also not obvious.
The module looks at the current menu path and explodes it by slash. Than it looks for alias to each path part.
In the module the result is called "an array of parent candidates".
Example: for path 'foo/bar/zee'
It will return array of internal Drupal paths for 'foo', 'foo/bar', 'foo/bar/zee'
Comment #7
sill commentedPatch from #4 works great! Thanks!
Can we get this committed to dev! Great module, minor feature addition to make it super rad!
Comment #8
srclarkx commentedI used this patch to keep the first parent candidate from being selected rather than the last candidate. The module messed up navigation highlighting for one section of the site. The patch is great.
I used this patch over, https://www.drupal.org/node/2413925, because most of the navigation highlighting was working fine.
Comment #9
davy-r commentedtriggering automated testing
Comment #11
davy-r commentedThanks for contributing