Copied to clipboard

Flag this post as spam?

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


  • suzyb 459 posts 868 karma points
    Aug 22, 2019 @ 10:38
    suzyb
    0

    Templates without Document Type

    In older versions of Umbraco if you had a root template that wasn't attached to a document type you could access that template as a page by calling it's name as the page URL.

    Does this functionality still work in Umbraco 8.1.1? I've converted over a general template we use to create a sitemap but it's giving a not found error. I'm not sure whether I've just missed something or this is no longer available in v8.

  • Paul Seal 395 posts 2156 karma points MVP 2x c-trib
    Aug 22, 2019 @ 11:55
    Paul Seal
    100

    Hi Suzy

    The 404handlers.config was removed

    You now control how the content finders work yourself with your own composer like this:

    using Umbraco.Core;
    using Umbraco.Core.Composing;
    using Umbraco.Web.Routing;
    
    namespace MyProject.Web.Compose
    {
        [RuntimeLevel(MinLevel = RuntimeLevel.Run)]
        public class ContentFinderComposer : IUserComposer
        {
            public void Compose(Composition composition)
            {
                //clear the collection
                composition.WithCollectionBuilder<ContentFinderCollectionBuilder>().Clear();
    
                //add them back in the right order
                composition.WithCollectionBuilder<ContentFinderCollectionBuilder>()
                    .Append<ContentFinderByPageIdQuery>()
                    .Append<ContentFinderByUrl>()
                    .Append<ContentFinderByIdPath>()
    
                    //add the url and template one back in here
                    .Append<ContentFinderByUrlAndTemplate>()
    
                    .Append<ContentFinderByUrlAlias>()
                    .Append<ContentFinderByRedirectUrl>();
            }
        }
    }
    

    I just tested it and it works for me.

  • suzyb 459 posts 868 karma points
    Aug 22, 2019 @ 13:27
    suzyb
    0

    Thanks, that saved me a massive headache.

    It's also lead me to take a look at the pipeline docs and reminded me of a few things that could end up causing some un-expected behaviour due to some changes we've made to our setup.

  • Paul Seal 395 posts 2156 karma points MVP 2x c-trib
    Aug 22, 2019 @ 13:42
    Paul Seal
    0

    No problem, glad i could help

Please Sign in or register to post replies

Write your reply to:

Draft