Copied to clipboard

Flag this post as spam?

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


  • Dany Wu 81 posts 114 karma points
    Jul 28, 2009 @ 03:02
    Dany Wu
    0

    "Single level" URL question

    I have recently upgraded from Umbraco 3 to the latest revision of Umbraco 4. I can't remember if I changed any settings on my previous Umbraco installation but all my URL appeared as "single level", regardless of the node level. I can have:

    -Content
      >Page1
        >SubPage1

    and the URL for SubPage1 is http://somedomain.com/SubPage1.aspx. However, in my current Umbraco 4 install it appears as http://somedomain.com/Page1/SubPage1.aspx. Is it possible to make it appear as it used to?

    Thanks,
    D.

  • Douglas Robar 3570 posts 4671 karma points MVP ∞ admin c-trib
    Jul 28, 2009 @ 04:36
    Douglas Robar
    3

    In the web.config file, set the following:

    <add key="umbracoHideTopLevelNodeFromPath" value="true" />

    It's the same setting in umbraco 4 as it was in umbraco 3.

    After changing this parameter you'll need to re-publish each page to re-generate the url. To do this, right-click on each of the top-level nodes (such as Page1 in your example) and select 'Publish'. Be sure to check the 'publish children' box as well.

    That should do it!

    cheers,
    doug.

  • Lee 1123 posts 3059 karma points
    Jul 28, 2009 @ 08:57
    Lee
    0

    Cool I didn't know you could do that... Thanks

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Jul 28, 2009 @ 09:31
    Sebastiaan Janssen
    0

    Very nice, but what happens if you make two documents with the same page name?

  • Dany Wu 81 posts 114 karma points
    Jul 28, 2009 @ 10:57
    Dany Wu
    0

    Thanks Doug, I knew about that one and had set it to true already. I guess I didn't describe it properly and my v3 website is somewhat different from v4 one. In my current v4 site I have a top level "container" page which redirects to the first subnode:

    -Content
      -RootLevel (Redirecting page)
        -Page1
            -SubPage1

    In this case SubPage1 still has Page1 in the URL. I guess this cannot be avoided as the config item only hides the top level node?

    @Sebastiaan, that issue can happen regardless of that config value though - I just tried it and managed to create another page on the same level, also called SubPage1...published with the same URL. If I navigate to that URL Umbraco seems to just serve the first document on that level with that name.

  • Douglas Robar 3570 posts 4671 karma points MVP ∞ admin c-trib
    Jul 28, 2009 @ 12:08
    Douglas Robar
    0

    You can over-ride the default URL (which is based on the hierarchy of the page in the content tree) if you create a docType property with the alias of  'umbracoUrlName' . Make it a textfield and enter the url (and path) to the page manually.

    See http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracourlname

    Or, an alternative... http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracourlalias

    cheers,
    doug.

  • 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