I'm trying to make little cute flag icons that switch between the different language versions of the site.
Could anyone give any pointers as how to achieve this? Changing Culture and UICulture doesn't seem to do anything.
Thanks a lot!
You can use the GetPage() method to get the URL for a page for a specific language branch and then use this URL to set up a link for your language switch flag.
Hi Kristian, I'm facing the same problem now, have you fixed it? would u please be so nice to put some source code here? I'm really new to Episerver and tried what Ted wrote above, didn't work, or maybe I screwed up somewhere, Would u please give a little help here? or Ted? some source could would be really helpful.
If you want to create a link to swap from some language to another you can use UriSupport.AddLanguageSelection(CurrentPage.LinkURL, "en");
I think you should use the StaticLinkURL instead. Then you will get the url to the page without the epslanguage specified in the url.
UriSupport.AddLanguageSelection(CurrentPage.StaticLinkURL , "en");
To check which languagebrances a page is created in, you can check the CurrentPage.PageLanguages.
BR, Tore Gjerdrum
Hi guys, thx for ur answer, excuse me if my question is stupid. I did tried that, very simple, I put UriSupport.Addlanguageselection(currentpage.linkurl,"en") on a button click even, but it doesn't seem to work. The page does exists in the selected languae and everything else seem to be fine also, what might the problem be? yeah, when I click the button, it added 'default.aspx' in the end of the url(I tested the start page). May u folks be so kind to explain a little? thx!