Search code examples
umbracoumbraco7

Umbraco routing not working outside Home node


To reproduce the issue create the following hierarchy:

  • Content
    • Home
      • Foo
        • Bar - The published URL will be <domain>/foo/bar
    • Foo
      • Bar - The published URLwill be <domain>/bar

Why does umbraco skip /foo/ when creating a page outside of Home? Is there a way to make nodes outside of Home stack the path as the nodes under Home?

Umbraco v7


Solution

  • I've managed to understand what's going on with the help from Umbraco community.

    By default umbraco treats each child of Content as a root node aka home page. This is controlled by the following setting in web.config <add key="Umbraco.Core.HideTopLevelNodeFromPath" value="true" />

    If I would extend my example by adding 3rd level like so: Content > Foo > Bar > Baz I would see that the published path of Baz is /bar/baz. Umbraco does stack the path but it removes the 1st level because it's considered the default route.