Copied to clipboard

Flag this post as spam?

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


  • Niels Henriksen 73 posts 276 karma points
    Mar 01, 2019 @ 18:18
    Niels Henriksen
    0

    Extending Umbraco 8 with new Section

    The biggest problem I have with Umbraco is extending it with a new Section and Tree (well - not the tree but the html).

    My TreeNodeCollection

     protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
            {
                var nodes = new TreeNodeCollection();
    
                var node = CreateTreeNode("1234", id, queryStrings, "Name", "icon-autofill", false);
                nodes.Add(node);
    
                return nodes;
            }
    

    So my edit.html should be in

    App_Plugins/WebshopSection/backoffice/CategoryTree/edit.html
    

    But when I click on the item to edit it Umbraco tells me that

    views/CategoryTree/edit.html
    

    does not exits - I cant find a specific rule for where the files should be.

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Mar 01, 2019 @ 22:58
    Marc Goodson
    100

    Hi Niels

    Decorate your controller with a 'PluginController' attribute

    [Tree("settings", "favouriteThingsAlias", TreeTitle = "Favourite Things Name", TreeGroup = "favoritesGroup", SortOrder = 3)] [PluginController("favouriteThings")] public class FavouriteThingsTreeController : TreeController

    this would make your edit file located at

    App_Plugins/favouriteThings/backoffice/favouriteThingsAlias/edit.html

    so in your case [PluginController("WebshopSection")]

    and make sure 'CategoryTree' matches the 'alias' of your custom tree.

    regards

    Marc

  • Cedric 15 posts 86 karma points
    Mar 02, 2019 @ 09:27
    Cedric
    0

    Hello, Answer solved this link : https://our.umbraco.com/forum/umbraco-8/95927-custom-section-umb-8 best regards, Cédric

Please Sign in or register to post replies

Write your reply to:

Draft