Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • zell 37 posts 90 karma points
    Mar 12, 2015 @ 05:30
    zell
    0

    Customizing Node Right Click Properties

    Hi,

    is there a way to add custom controls into the right click menu of a node?

    i.e. as attached screen shot.

     

    cheers,

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 12, 2015 @ 06:22
    Sören Deger
    101

    Hi zell,

    yes, you can do this with tree events and a custom property editor written with angularJS:

    Tree Events:
    https://our.umbraco.org/documentation/extending-umbraco/section-trees/trees-v7

    AngularJS:
    https://our.umbraco.org/Documentation/Extending-Umbraco/Property-Editors/creating-tutorial1-v7

    Example for register tree events:

    private void ContentTreeController_MenuRendering(Umbraco.Web.Trees.TreeControllerBase sender, Umbraco.Web.Trees.MenuRenderingEventArgs e)
    {
                    switch (sender.TreeAlias)
    {
                        case "content":
                            //creates a menu action that will open /umbraco/currentSection/itemAlias.html;
                            var i = new Umbraco.Web.Models.Trees.MenuItem("itemAlias", "Item name");

                            //optional, if you dont want to follow conventions, but do want to use a angular view
                            i.AdditionalData.Add("actionView", "path to your angularJS view");
     
                            //sets the icon to icon-wine-glass 
                            i.Icon = "message";

                            //insert at index 5
    e.Menu.Items.Insert(5, i); break; 

    Hope this helps?

     

    Best,

    Sören

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies