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?
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?
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.
Awesome. Got it working in 5 minutes. Thanks :)
is working on a reply...