Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Mar 13, 2014 @ 03:23
    Tom
    0

    Umbraco v6 Appending Item to Existing Tree?

    Hi I was just wondering if it's possible to use the Tree attribute and inherit from BaseTree to then append an admin node to an existing tree?

     

    I'd like to add one to the end of the uCommerce tree so I tried:

    [Tree("uCommerce", "uc_orderexport", "Order Export", sortOrder: 100)]
        public class OrderExportTree : BaseTree
        {
            public OrderExportTree(string application)
                : base(application)
            { 
            }
    
            public override void Render(ref XmlTree tree)
            {
                var exportNode = XmlTreeNode.Create(this);
                exportNode.NodeID = "uc_export";
                exportNode.Action = "javascript:openOrderExportPage();";
                exportNode.Icon = "../../../App_Plugins/UmbracoBackoffice/Icons/export_pastiche_order.png";
                exportNode.OpenIcon = "../../../App_Plugins/UmbracoBackoffice/Icons/export_pastiche_order.png";
                exportNode.HasChildren = false;
                exportNode.Menu = new List<IAction>();
                OnBeforeNodeRender(ref tree, ref exportNode, EventArgs.Empty);
                if(exportNode != null)
                {
                    tree.Add(exportNode);
                    OnAfterNodeRender(ref tree, ref exportNode, EventArgs.Empty);
                }
            }
    
    
            protected override void CreateRootNode(ref XmlTreeNode rootNode)
            {
            }
    
            public override void RenderJS(ref System.Text.StringBuilder Javascript)
            {
                Javascript.Append(
                   @"function openOrderExportPage() {
                     UmbClientMgr.contentFrame('/UmbracoBackoffice/DataExportSurface/Index);
                    }");
            }
        }

    With no luck

    is this possible?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 13, 2014 @ 12:49
    Jeroen Breuer
    0

    Have a look at the source of the Config Tree package. That adds a tree to the settings section.

    https://github.com/leekelleher/umbraco-config-tree

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft