<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.

Comments

Status:Active» Needs review
StatusFileSize
new3.63 KB

cleaned code and do not allow default for -by-id

one more tiny clean