I have a issue with returning the domain of specific node but taking into considerations the request url. I have a multilanguage umbraco instance, for example HomePage EN and HomePage DE.
For the EN instance I've defined the following domain: example.com, example.co.uk and for DE example.com/de, example.co.uk/de. I want when I'm coming from example.co.uk English language to take the url for the German language, so example.co.uk/de. At the moment if I'm doing something like umbraco.library.NiceUrl(nodeid) with the german node I'm getting the first domain (example.com/de, NOT example.co.uk/de ).
How have you structured the sites in the backoffice? Could you share a screendump of that? Perhaps this article on how to build a language picker can give you some inspiration as well http://24days.in/umbraco/2014/razor-language-switcher/
Since you're on 6.2.4 the approach should be the same since the underlying API's etc. should be the same so the code demoed in the example should do the trick I think.
NiceUrl(nodeid) or Umbraco.TypeContent(nodeid).Url returns the default domain
Hello umbraco devs,
I have a issue with returning the domain of specific node but taking into considerations the request url. I have a multilanguage umbraco instance, for example HomePage EN and HomePage DE.
For the EN instance I've defined the following domain: example.com, example.co.uk and for DE example.com/de, example.co.uk/de. I want when I'm coming from example.co.uk English language to take the url for the German language, so example.co.uk/de. At the moment if I'm doing something like umbraco.library.NiceUrl(nodeid) with the german node I'm getting the first domain (example.com/de, NOT example.co.uk/de ).
Do you have any ideas?
The umbraco version I'm using is 6.2.4.
Many thanks,
Ligia
Hi Ligia
How have you structured the sites in the backoffice? Could you share a screendump of that? Perhaps this article on how to build a language picker can give you some inspiration as well http://24days.in/umbraco/2014/razor-language-switcher/
/Jan
Hi Jan,
Thank you very much for your answer. Please see my structure here:
Nice tip, but the package you've indicated is not tested for the version I'm using but I'll try it.
Many thanks,
Ligia
P.S the EN node has the following hosts:example.com and example.co.uk; the DE one has example.com/de and example.co.uk/de
Hi Ligia
Since you're on 6.2.4 the approach should be the same since the underlying API's etc. should be the same so the code demoed in the example should do the trick I think.
/Jan
Hello,
Have a look at the SiteDomainHelper. With that you can define what domains should be related. This topic can also help: https://our.umbraco.org/forum/core/general/46842-Multiple-hostnames-for-one-root-node-how-does-it-work
Jeroen
Hi Jeroen,
That is brilliant, it helped me a lot and I succeeded solving my issue. Thank you very much
Ligia
is working on a reply...