<menu-parent-trail>
is useful but it doesn't include the actual path, and there are places that might be needed.
For instance I have a view, which is a sub menu of a primary link, and that view list nodes of a specific content types.
When viewing a node I want to make both the view and the full menu parent trail the bradcrumbs.
I know I can do this manually by using and then manually typing the actual view, but I rather use the data from the menu, in case I ever change it.
Attached are two new identifiers which uses the same approach as menu-parent-trail but works for a specific menu item.
I also did it so you can use it by path or by menu id. Menu ID is important as one path can be on several menus. I first thought of doing an if (is_numeric()) inside one single identifier, but there's no limitations to making an actual drupal path a number, so I rather do it like this.
To be honest, I had problems with menu-parent-trail with paths on different menus, so I think this approach has to be extended to that one. I don't mind rolling a patch to that as well. Will comment about this on the original issue.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1234566-3-new-identifiers-for-menu-items.patch | 4.09 KB | hanoii |
#2 | 1234566-2-new-identifiers-for-menu-items.patch | 4.16 KB | hanoii |
#1 | 1234566-1-new-identifiers-for-menu-items.patch | 3.63 KB | hanoii |
Comments
Comment #1
hanoiiComment #2
hanoiicleaned code and do not allow default for -by-id
Comment #3
hanoiione more tiny clean
Comment #4
lamp5