Copied to clipboard

Flag this post as spam?

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


  • Lee Higgitt 8 posts 88 karma points
    Jun 17, 2020 @ 08:21
    Lee Higgitt
    0

    Tree Group sort order in the settings section of the back office

    Hi All!

    Hoping you can shed some light on how I can change the sort order of a tree group in the back office.

    I have 2 tree controllers, each with a single node that I return using "CreateRootNode".

    When I run my umbraco project my tree group appears before the vanilla "Settings" tree group, see below: Trees

    I'm trying to get my tree group to appear after "Settings".

    I assume that it was the SortOrder parameter on the "Tree" attribute (applied to the tree controller) but I've played about with this and it hasn't changed anything. I've also taken a look at the uSync source code as Kevin has achieved what I'm attempting to achieve and all I can see that he's done is specify the sort order, which again does nothing for me.

    here's one of my tree controllers:

    [Tree(
            global::Umbraco.Core.Constants.Applications.Settings, 
            Constants.Trees.Configuration.ALIAS, 
            TreeGroup = Constants.Trees.GROUP_NAME, 
            TreeTitle = Constants.Trees.GROUP_NAME, 
            SortOrder = 34)]
        [PluginController(Constants.PACKAGE_ID)]
        public class ConfigurationTreeController : TreeController
        {
            /// <inheritdoc />
            protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) => new TreeNodeCollection();
    
            /// <inheritdoc />
            protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) => null;
    
            /// <inheritdoc />
            protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
            {
                var routePath = $"{Constants.PACKAGE_ID}/{Constants.Trees.Configuration.ALIAS}/index";
    
                var node = base.CreateRootNode(queryStrings);
                node.RoutePath = routePath;
                node.Icon = Constants.Trees.Configuration.ICON;
                node.HasChildren = false;
                node.MenuUrl = null;
                node.Name = Constants.Trees.Configuration.ALIAS;
                return node;
            }
        }
    

    All in all throrughly confuddled and would appreciate any help anyone is able to provide!

    Thanks,

    Lee

  • 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