Copied to clipboard

Flag this post as spam?

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


  • Murray Roke 503 posts 967 karma points c-trib
    Feb 26, 2019 @ 02:54
    Murray Roke
    0

    umbracoHideTopLevelNodeFromPath = "false" returns "/" not "/en/"

    Given this query:

    UmbracoContext.Current.ContentCache.GetAtRoot().Where(x => x.DocumentTypeAlias == "homepage")
    

    Why is the "Url" property of my english homepage = "/" and the URL of my chinese homepage = "/cn/" ?

    I want english to be "/en/" not "/"

    I have <add key="umbracoHideTopLevelNodeFromPath" value="false" /> Is there anything else that could affect this?

    Umbraco version 7.12.4

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Feb 26, 2019 @ 11:20
    Alex Skrypnyk
    0

    Hi Murray,

    Can you add to managing hostnames /en as a host for English version of the website?

    Thanks,

    Alex

  • Murray Roke 503 posts 967 karma points c-trib
    Feb 26, 2019 @ 20:20
    Murray Roke
    100

    Thanks for the suggestion Alex, but...
    Not exactly...
    I cannot add /en I could add localhost:9005/en as a hostname. Which does work, but it seems very wrong, and I do sometimes copy the DB between environments where the hostnames are different, so I don't want to do that.

    my hacky work-around currently is:

    HomePageUrl = ipc.Url == "/" ? $"/{ipc.UrlName}/" : ipc.Url
    
  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Feb 26, 2019 @ 21:25
    Alex Skrypnyk
    0

    you can add hostnames for all environments there, it's not a problem for Umbraco

  • 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