Copied to clipboard

Flag this post as spam?

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


  • James 5 posts 75 karma points
    Dec 10, 2019 @ 10:21
    James
    0

    Ordering Custom Sections

    Hi, I have added a new section to my Umbraco 8 website using the documentation https://our.umbraco.com/documentation/extending/section-trees/sections. If possible I would like for my new section to appear before the other default sections. I tried adding a "weight" value to the package.manifest which works for ordering Dashboards. Unfortunately that does not work on Sections so I was hoping somebody could let me know if there is a way for me to do this as the documentation does not cover available/possible settings.

    Thanks, James

  • James 5 posts 75 karma points
    Dec 10, 2019 @ 11:31
    James
    0

    I have managed to find out how to insert the section by registering it at startup:

    [RuntimeLevel(MinLevel = RuntimeLevel.Run)]
    public class StartupComposer : IUserComposer
    {
    
        public class MySection : ISection
        {
            public string Alias => "mySection";
            public string Name => "My Section";
        }
    
        public void Compose(Composition composition)    {
            composition.Sections().Insert(0, typeof(MySection ));
        }
    }
    

    However I now need to know how to change the tab name from [mySection] (It defaults to the alias enclosed in square brackets). Using the link from my OP I was able to specify the name in a lang/en-US.xml file to fix this. I cannot find documentation explaining how to decorate my ISection class to acieve the same result.

    Thanks, James

  • James 5 posts 75 karma points
    Dec 10, 2019 @ 11:41
    James
    0

    Ah okay, it seems I can just use a plugin for the sole purpose of adding a lang directory with the translations in the same way as the original link - but without the need for the manifest.

Please Sign in or register to post replies

Write your reply to:

Draft