Copied to clipboard

Flag this post as spam?

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


  • Ligia 15 posts 74 karma points
    Apr 02, 2015 @ 13:00
    Ligia
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 03, 2015 @ 16:34
    Jan Skovgaard
    0

    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

  • Ligia 15 posts 74 karma points
    Apr 07, 2015 @ 10:35
    Ligia
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 07, 2015 @ 10:40
    Jan Skovgaard
    0

    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

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Apr 07, 2015 @ 12:08
    Jeroen Breuer
    100

    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

  • Ligia 15 posts 74 karma points
    Apr 07, 2015 @ 13:10
    Ligia
    0

    Hi Jeroen, 

    That is brilliant, it helped me a lot and I succeeded solving my issue. Thank you very much 

    Ligia

Please Sign in or register to post replies

Write your reply to:

Draft