Try our conversational search powered by Generative AI!

Change language and change host


I'v defined the following in my web.config

              <add name="" language="en" />
              <add name="" language="sv" />
              <add name="*" />

works like a charm.

Now, if I want to change language when surfing around on one site to the other, can I in a easy way change the host defined in siteHosts aswell?

Today i use the following:

return string.Format(@"<a href=""{0}"" class=""{1}"">{2}</a>", EPiServer.UriSupport.AddLanguageSelection(pd.LinkURL, pd.LanguageID), pd.LanguageBranch, Translate("/lang/" + pd.LanguageBranch));

I guess I can use EPiServer.Configuration.SiteElement to obtain the siteHost, but is there a method that can do this automagically? 

May 15, 2008 17:51
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.