I'm trying to setup Umbraco to support Multiple sites but each site must also support multiple languages, at least two. I was able to make it work as follow:
The only catch is I don't know how to assign the culture locale to the language node, it's there any property type to help with this? Or should I do a custom solution?
You can do this by right clicking on the language node(en or de) and add a hostname. The hostname can be something like "/en" or "/de", but there you can also set the language which will change the culture.
Hmm looking at his site structure it's not recommended to set umbracoHideTopLevelNodeFromPath to false. His top level is "corporate website" and that should be hidden. That way the url's will look like this website.com/nl or website.com/de
I've seen problems with configuration where there're several top-level nodes and umbracoHideTopLevelNodeFromPath=true. First of all URLs are somehow confusing, e.g.:
en -----> / Contacts -----> /contacts/ de ------> /de/ Kontakt ----> /kontakt/ (you see - it's not "/de/kontakt/" as it might have been expected)
A much worse thing happens when there're two pages with the same name under both of the trees - from my experience they will be simply unavailable (404 ugly page) till you unpublish one of them.
Since that I'd rather avoid such a configuration.
Back to our case - why not to put both top-level nodes (Corporate and Country) under a single fake Home and to set up redirection from it (e.g. Home -> Corporate)?
Thanks for your answer but I see some problems asociated with that solution. By adding a domain in the language node as you described I get following URL in the children pages:
Hi, Vlax. You can use the "umbracoInternalRedirectId" feature so there'll be no redirect the "/" url will simply display for instance your "Corporate" page. By the way it's quite a significant thing - are your "Corporate" and "Country" subsites supposed to be accessed by different domain names? If yes, then initial configuration (two top-level nodes + hide tope level nodes) will be absolutely OK. Some time ago I was experimenting with multiply top-level nodes configurations and I'd rather say that it's suitable only in case you separate these nodes by a domain name - otherwise it goes awfull headache.
I think you can still set the language with a hostname as I described, but instead of adding /en or /de as a name you should set the domain (without http or www). So could you try this as hostnames:
Corporate Site en set: hostname = en.corporate.com , lang = English ru hostname = ru.corporate.com , lang = Russian Country Site en hostname = en.country.com , lang = English ru hostname = ru.country.com , lang = Russian
And also, in fact you can safely not bother about the value of "useDomainPrefixes" if parts of your site with different domain names don't refer to each other.
Umbraco need the hostnames set in the first nodes beneath the content node, otherwise the nodes in a similar structure in the succesive domains hosted get overcast by the ones in the first domain...
for example as an hint the second domain in row will show the following as the link to document...
So I'm going back to my original idea of setting the locale in a recursive variable...
Yeah. I had just been going to say that it's impossible to be workable. Umbraco looks up a domain in the database table comparing its name to the server variable SERVER_NAME. So that anything that cannot be a pure host name (like foo.com/en or bar.org/fi) is out of search automatically. Such domain records will be just ignored. I also tried your last configuration and realised that NiceUrl() returned utter gibberish as well.
Hmm I think I also had this problem. Didn't find a good solution for this. Only thing I changed was to make sure the language node names where unique. So it's like this:
website1.com/ensite1
website1.com/desite1
website2.com/ensite2
website2.com/desite2
Not the most pretty solution, but it does work and it's fast and easy to apply.
Finally I decided to create a locale property in the language node, then I will add a server control or a Razor script that run on each page to set the appropiate locale.
Creating Multilingual / Multisite Installation
Hi
I'm trying to setup Umbraco to support Multiple sites but each site must also support multiple languages, at least two. I was able to make it work as follow:
The only catch is I don't know how to assign the culture locale to the language node, it's there any property type to help with this? Or should I do a custom solution?
Best Regards
Vlax
You can do this by right clicking on the language node(en or de) and add a hostname. The hostname can be something like "/en" or "/de", but there you can also set the language which will change the culture.
Jeroen
And don't forget to change "umbracoHideTopLevelNodeFromPath" value to FALSE in web.config
Hmm looking at his site structure it's not recommended to set umbracoHideTopLevelNodeFromPath to false. His top level is "corporate website" and that should be hidden. That way the url's will look like this website.com/nl or website.com/de
Jeroen
In this case you're right :)
I've seen problems with configuration where there're several top-level nodes and umbracoHideTopLevelNodeFromPath=true. First of all URLs are somehow confusing, e.g.:
en -----> /
Contacts -----> /contacts/
de ------> /de/
Kontakt ----> /kontakt/ (you see - it's not "/de/kontakt/" as it might have been expected)
A much worse thing happens when there're two pages with the same name under both of the trees - from my experience they will be simply unavailable (404 ugly page) till you unpublish one of them.
Since that I'd rather avoid such a configuration.
Back to our case - why not to put both top-level nodes (Corporate and Country) under a single fake Home and to set up redirection from it (e.g. Home -> Corporate)?
Hi Jeroen
Thanks for your answer but I see some problems asociated with that solution. By adding a domain in the language node as you described I get following URL in the children pages:
Not exactly what I was hopping for :)
Is there a workaround for this?
Thxs and regards
Vlax
Hi Rodion
I will explore your solution but I have read that starting a site with a rediction is not very SEO friendly...
Thxs and Regards
Vlax
I think, that you need to change property in umbracoConfig file.
<useDomainPrefixes>false</useDomainPrefixes> to true
and recycleapp pool
Sorry , umbracoSettings.config file :)
Hi, Vlax. You can use the "umbracoInternalRedirectId" feature so there'll be no redirect the "/" url will simply display for instance your "Corporate" page. By the way it's quite a significant thing - are your "Corporate" and "Country" subsites supposed to be accessed by different domain names? If yes, then initial configuration (two top-level nodes + hide tope level nodes) will be absolutely OK. Some time ago I was experimenting with multiply top-level nodes configurations and I'd rather say that it's suitable only in case you separate these nodes by a domain name - otherwise it goes awfull headache.
Hi Yarik
I have already useDomainPrefixes set to true.
Thanks for the tip
Vlax
Hi Rodion
Both "Corporate" and "Country" subsites have different domain names, and in fact I have also the "umbracoInternalRedirectId" in place.
I think I will set a recursive variable in the language nodes and set the Thread Culture and Locale in an user control on each page...
Thxs and regards
Vlax
Hi Rodion,
I think you can still set the language with a hostname as I described, but instead of adding /en or /de as a name you should set the domain (without http or www). So could you try this as hostnames:
website.uk (en example)
website.de (de example)
Than if you look at url's the should be fine :).
Jeroen
Hi, Vlax. That's absolutely great. Just yet another question - do you fully control those domains?
My proposal to Vlax is following.
Hostname settings:
Corporate Site
en set: hostname = en.corporate.com , lang = English
ru hostname = ru.corporate.com , lang = Russian
Country Site
en hostname = en.country.com , lang = English
ru hostname = ru.country.com , lang = Russian
Other settings:
umbracoHideTopLevelNodeFromPath = true;
useDomainPrefixes = true;
So that what we will have:
Corporate Site
en url: http://en.corporate.com/
ru http://ru.corporate.com/
Country Site
en http://en.country.com/
ru http://ru.country.com/
No conflicts between diferent parts of the tree and proper current language when visiting every part of the site.
And also, in fact you can safely not bother about the value of "useDomainPrefixes" if parts of your site with different domain names don't refer to each other.
Hi Rodion
Thanks for your proposal, but I don't fully control the domains...
Regards
Vlax
Hi Jeroen
That's not an option because I still want to use separate directories structures for the languages...
But I think you gave me an hint on what can work!
Regards
Vlax
OK here a config that seems to work.
I set the hostname to:
corportatesite.com/en in the (en) language node beneath the corporate node.
repeated the same for the (de) node
did a republish site in the content node (very important !!!) and now everything is showing fine!
Thxs for all the support guys!
In fact I got the idea from your suggerences and also from following guide:
http://webmove.be/home/blog/blog/2011/august/multilanguage-websites-with-umbraco-part2
Regards
Vlax
Bad news, I was claiming victory too early:
Umbraco need the hostnames set in the first nodes beneath the content node, otherwise the nodes in a similar structure in the succesive domains hosted get overcast by the ones in the first domain...
for example as an hint the second domain in row will show the following as the link to document...
So I'm going back to my original idea of setting the locale in a recursive variable...
Regards
Yeah. I had just been going to say that it's impossible to be workable. Umbraco looks up a domain in the database table comparing its name to the server variable SERVER_NAME. So that anything that cannot be a pure host name (like foo.com/en or bar.org/fi) is out of search automatically. Such domain records will be just ignored. I also tried your last configuration and realised that NiceUrl() returned utter gibberish as well.
Hmm I think I also had this problem. Didn't find a good solution for this. Only thing I changed was to make sure the language node names where unique. So it's like this:
website1.com/ensite1
website1.com/desite1
website2.com/ensite2
website2.com/desite2
Not the most pretty solution, but it does work and it's fast and easy to apply.
Jeroen
Did you find a solution for you setup? Really interested in what the best solution is.
Jeroen
Hi Jeroen
Finally I decided to create a locale property in the language node, then I will add a server control or a Razor script that run on each page to set the appropiate locale.
Didn't tested yet but it should work...
Regards
Vlax
I arrived at the same solution. creating a locale property in the language node then changing the executing thread culture on each page.
http://our.umbraco.org/forum/using/ui-questions/25868-Advice-required-for-best-multilingual-approach
is working on a reply...