Nibble

Umbraco v7 trees, DefaultMenuAlias

Something you can do in trees created with a TreeController is define a default menu item. So instead of having the ability to choose an action it will default to the set action (like in content it will default to create).

To do this all you have to set is the DefaultMenuAlias property on your menu.

So in the example project I created I just add menu.DefaultMenuAlias = ActionDelete.Instance.Alias;

to make delete the default action on my tree items (it’s also the only option so it makes sense to default to it).

So now I don’t get the following screen anymore (the overview of available actions)

actions

but it will default to the delete action immedialty showing the delete dialog

default

If you stil wish to show the overview you can use nav.hideDialog(true) in your view

Leave a Reply