Copied to clipboard

Flag this post as spam?

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


  • Peter S 64 posts 106 karma points
    Oct 01, 2009 @ 15:04
    Peter S
    0

    NiceUrl not working nice with multilingual site

    Hi,

    I've got some problems with the NiceUrl function. I've got this simple site in two languages. So I copied the first tree to get this result:

    http://www.grabout.com/Default.aspx?i=bbae17af-8185-4aee-8fab-abbec1e10e21

    And I've configured the second site to run in a directory '/EN', so I can access the second (English) homepage by browsing to 'localhost/EN/home-en.aspx.
    That all works fine. The problem is in the navigation. All links in the navigation have a leading '/' in front of them, so they all refer to the root again, and since the names of the pages are the same for both languages, the links work, but you're returned to the default language. That's not what I want for the pages in the English section. Is there a way to get NiceUrl to return a relative URL?

     

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Oct 01, 2009 @ 16:39
    Morten Bock
    0

    Just to understand, you want localhost/Contact.aspx to show default language and localhost/en/contact.aspx to show the english version?

    I don't think I have seen that done anywhere.

    What I usually do is create a "folder" for each language:

    Content
    - DA (Homepage for danish)
    - - Contact
    - - Business Partners
    - EN (Homepage for english)
    - - Contact
    - - Business Partners

    In the web.config you can then specify <add key="umbracoHideTopLevelNodeFromPath" value="false" /> which will make NiceUrl generate urls like:

    localhost/da/contact.aspx
    localhost/en/contact.aspx

    So both languages have a prefix in their url's.

  • Peter S 64 posts 106 karma points
    Oct 01, 2009 @ 17:47
    Peter S
    0

    Awesome. Got it working in 5 minutes. Thanks :)

Please Sign in or register to post replies

Write your reply to:

Draft