In Umbraco 7, MenuItem.AdditionalData.Add("a", "a") worked just fine.
But since I began using Umbraco 8, the data would not get registered in the $scope in my controller.js. Does anybody has a solution for this?
The issue is still open. In the code sample above I get all menu actions for the current node. If I can create several different things, I don't know, which of the actions was chosen by the user.
We definitely need a way to get the current action.
The current menu item has a dialogTitle field which I use as a way to get the current menuAction. I am not 100% sure this is the right way to do it, but for now it works fine for me.
var menuActions = appState.getMenuState('menuActions')
var menuTitle = appState.getMenuState('dialogTitle')
var menuAction = menuActions.find(function (element) {
if (element.name === menuTitle) {
return element.name
}
}).metaData
MenuItem.AdditionalData
In Umbraco 7, MenuItem.AdditionalData.Add("a", "a") worked just fine. But since I began using Umbraco 8, the data would not get registered in the $scope in my controller.js. Does anybody has a solution for this?
I have the same phenomenon. In my TreeController I have the following Code:
In my controller I used to use this line to get the additional data:
Now in Umbraco v8 currentAction is undefined.
Any insights?
I got it:
The issue is still open. In the code sample above I get all menu actions for the current node. If I can create several different things, I don't know, which of the actions was chosen by the user.
We definitely need a way to get the current action.
The current menu item has a dialogTitle field which I use as a way to get the current menuAction. I am not 100% sure this is the right way to do it, but for now it works fine for me.
@Davy: I analyzed the menu code and found that the dialogTitle solution is the only way to get the metaData. But this is far from being elegant.
The current action should be added to the menu state in navigationService.showDialog:
I think I'll open a ticket for this issue.
Did a ticket get opened for this?
is working on a reply...