Problem/Motivation
We want to re-use a local context menu from a referencing node on it referenced node.
Setup:
Node1 references Node2 and Node3
We have custom subpages on Node1, like node/%node/pages, node/%node/employees etc.
Examples
- On Node2 & Node3, we want to show these same links which contextually belongs to Node1.
- We want to show links to the local tasks on the teaser view of a node.
Proposed resolution
Make it possible to pass a $router_item to the menu_local_tasks, making it possible to get local menus for a specific nodes when not on that nodes content page.
Remaining tasks
All aspects should be covered in the patch.
User interface changes
None.
API changes
None. (I do not consider adding a new optional parameter to a function for an API change, but please correct me if I am wrong)
Data model changes
None.
Comments
Comment #2
lslinnet commentedAdded patch.
Unsure if there should be tests added for this and a little unsure how to write those to correctly test this change.
Comment #3
elioshI need this to show a user local task regardless of current path.
Thanks a lot !
Comment #4
elioshRegarding API change, we can think to create a "subfunction", something like this: