Copied to clipboard

Flag this post as spam?

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


  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Apr 14, 2015 @ 16:27
    Chris Houston
    0

    How to change the default Umbraco Section (i.e. not Content)

    Hi All,

    We are working on a (Umbraco 7.2.2) site where we have added our own section, if we change the sort order of the sections in the Application.config file so that our section is at the top it is shown at the top of the list which is great, however when a user first logs in it still defaults to the Content section ( which in our list is the second section )

    This doesn't seem very intuitive as I would have thought the first section would always be the one that gets loaded? Does anyone have any idea if there is a config option for this or perhaps I need to add a feature request on the Issues tracker?

    Cheers,

    Chris

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Apr 14, 2015 @ 23:48
    Chris Houston
    102

    Well after digging around in the Umbraco source I have found that in the "/umbraco/Js/routes.js" file in the RouteProvider there is the following snippet of code:

    .when('/:section', {
        templateUrl: function (rp) {
            if (rp.section.toLowerCase() === "default" || rp.section.toLowerCase() === "umbraco" || rp.section === "") {
                rp.section = "content";  
            }
    
            rp.url = "dashboard.aspx?app=" + rp.section;
            return 'views/common/dashboard.html';
        },
    

    When Umbraco first loads rp.section is a blank string and hence this function just hard codes that the section should be "content" which is the reason it's currently impossible to change the default section that is shown without hacking the Umbraco source.

    I think this should some how come from the Application.config file's first item, for now, it's possible to just change this hard coded value to the name of your own Section for the required result.

    I have created a ticket on the Umbraco issue tracker here: http://issues.umbraco.org/issue/U4-6521

    Cheers, Chris

Please Sign in or register to post replies

Write your reply to:

Draft