Custom context menu / menu state / current node id
I have the following development on Umbraco 7:
Custom menu item added to the content tree
Menu item points to a new custom plugin in App_Plugins
Require access to the current selected node id in order to execute the controller code for the plugin.
The problem is that its not easy to get the current "selected" not id - i.e. the node is that the user right clicked on.
I can use either the editorState or the $routeParams to get the current "active" (i.e. highlighted in blue). However, that may not necessarily be the actual menu item that the user right clicked on.
After digging around I have now found that the following will give me access to the correct menu state:
appState.getMenuState("currentNode")
Is there any other way to get access to the current selected node? It this the best way?
Custom context menu / menu state / current node id
I have the following development on Umbraco 7:
The problem is that its not easy to get the current "selected" not id - i.e. the node is that the user right clicked on.
I can use either the editorState or the $routeParams to get the current "active" (i.e. highlighted in blue). However, that may not necessarily be the actual menu item that the user right clicked on.
After digging around I have now found that the following will give me access to the correct menu state: appState.getMenuState("currentNode")
Is there any other way to get access to the current selected node? It this the best way?
Thanks
Martin
Thanks to this hint, I managed to dig around in the source a bit.
I think the "official" way to get it is to use:
is working on a reply...