There are some contribute modules (like nodetrail and menutrails) that are doing this job. I've extended the node trail module (see #524640: Integrate nodetrails into the menu settings section (provided by the core menu module)) so that it plays well together with the node.module. With the changes I reached the following behavior:
If the "Menu link title" is left (or set to) blank and the "Parent item" is selected then the current node will be added to the "node trail". This means the current node behaves like a child of the parent item. If the node will be shown then the breadcrumb and the menu trail will set as expected.
I'm not informed about the the changes to the d7 menu system, but I'd like to propose to add this behavior to the menu system. I think there are only a few changes necessary, so it could be realized until code freeze.
Comment | File | Size | Author |
---|---|---|---|
#2 | 545052-menu-settings.png | 50.47 KB | osopolar |
Comments
Comment #1
sunPlease provide some screenshots that explain what you want to do here.
Comment #2
osopolarOk, here is the screen shot. Do you understand what I want to do?
I just want to associate a node with a menu item. There are some modules like menutrails and nodetrail which does this job. Nodetrail uses an extra settings field. I thought that this extra field is not necessary instead we could integrate it in the current menu settings by just providing the parent item (without setting a link title). ... its just a way to integrate the nodetrail module in the menu module.
Comment #3
sunI think I now get what you mean.
Basically the functionality of Menu Trails module: Allowing to assign all objects of a certain type (node type pages, term pages, etc.) to a certain parent menu item that already exists, so the menu on such a page is expanded to the assigned parent - although the current page has no menu link in the menu.
Better title. Bumping to D8.
Comment #4
osopolaryes, almost. Its more like node trail, because I want to manually assign a object (node) to a certain (existing) parent menu item.
If you want to see how it may work just install the node trail module
Comment #5
momper CreditAttribution: momper commented+1 for usability this is a must in core
Comment #6
osopolarchanged title to reflect #4
Comment #7
Alan D. CreditAttribution: Alan D. commentedAfter looking at the node for NodeTrails (additional table), would it be simply a matter of updating the menu hidden value handle this? I do not know what happens with deeper menu structures, but it is a simple way to add a trail with a standard normal items.
A very naive hack at the problem using a form alter, (I think a checkbox would require changes in the menu module, so using radios):
If this is a valid approach, then I would suggest changing the hidden form element to a checkbox and changing the menu parent select to include all items including the hidden items. It would require some UI testing, many find menus confusing as it is :)
I think that I would want to still have menu titles, as nested untitled menu items would be confusing as on the menu admin screens.
Comment #8
JohnAlbinThis is a dupe of #520106: Allow setting the active menu trail for dynamically-generated menu paths.
Comment #9
JohnAlbinComment #10
sunNope, this one actually is a product feature request, i.e., as mentioned before, something like menutrails module in core.
Comment #11
jhedstrom