Copied to clipboard

Flag this post as spam?

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


  • Peter S 169 posts 587 karma points
    Aug 05, 2014 @ 11:27
    Peter S
    0

    Questions regarding custom sections

    Using code I copied I found in a blog post I created a custom section in the backoffice. I've got some question on how to keep using this?

    First off, how can I remove the ... button from the links in the section. I'd like them to act strictly as links and not have the create, reload, etc. links on them. I see these options in other places in the regular backoffice sections but I can't find out how to remove them from my links.

    Second, how can I point the links to a mvc page instead of the edit.html/create.html pages that they link to now?

    This is the code I use so far:

    [PluginController("CustomSection")]
        [Umbraco.Web.Trees.Tree("CustomSection", "CustomSectionTree", "My custom section", iconClosed: "icon-doc")]
        public class CustomSectionTreeController : TreeController
        {
            protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
            {
                var nodes = new TreeNodeCollection();
                if (id == "-1")
                {
                    nodes.Add(this.CreateTreeNode("dashboard", id, queryStrings, "My item", "icon-3d", true));
                }
                return nodes;
            }
    
            protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
            {
                var menu = new MenuItemCollection();
                //menu.DefaultMenuAlias = ActionNew.Instance.Alias;
                //menu.Items.Add<ActionNew>("Create");
                return menu;
            }
        }
  • Paul 25 posts 75 karma points
    Aug 06, 2014 @ 12:37
    Paul
    0

    Hi Peter, 

    I found the same blog post and using that as a guid and i think i am trying to achieve a similar goal as you. 

    If i figure it out i will let you know.

    Paul

  • Paul 25 posts 75 karma points
    Aug 06, 2014 @ 13:47
    Paul
    0

    Hi Peter,

    After some searching I have found another forum post Tree Actions that shows how to get a tree node to go to a different route. In my example I have an export.html file in the app plugins folder.

        protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
        {
            var nodes = new TreeNodeCollection();
            TreeNode item = this.CreateTreeNode("fileDownload", null, queryStrings, "File Downloads", "icon-server", false, "/CustomSection/CustomSectionTree/export/id");
            nodes.Add(item);
            return nodes;
        }
    

    Paul

Please Sign in or register to post replies

Write your reply to:

Draft