Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Language LinksLanguage Links
Previous
 
Next
New Post
10/21/2010 8:46 AM
 
I have a multilanguage site and the flags are spread in a specified area so I have to make manually some links in order to allow the user to change the language. I found in a page that I could use the following syntax in order to make these links:



<a href="<% = ResolveURL("~/") %>?language=el-GR">Greek</a>

<a href="<% = ResolveURL("~/") %>?language=en-US">English</a>



They work but the problem is that when you click the link it does not show the current page but it displays the home page of the site. How could I transform it in order to move to selected language the current page?
 
New Post
10/21/2010 6:36 PM
 
the tilde "~" always resolves as the root, you need to resolve as the current page e.g. using Globals.NavigateURL() or else extracting the path from the servervariables collection

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
10/22/2010 1:44 AM
 
I tried this function but the url that returns include the language parameter which is the current selected langauge. I want the url without this paramter so that I will set it myself according to my needs. For the following code I just tested:



    Response.Write(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "language=el-GR"))

     

I had the following result:



    http://localhost/villaouranosdnn/HOME... 



As you can see the language parameters appears 2 times. The first is the one that I used and the second is for the current language. What should I do so that it will include in the url only the language that I pass in the parameter?
 
New Post
10/22/2010 8:33 AM
 
I goggled around and I found the following script in order to change the language:

' Store selected language in cookie
Localization.SetLanguage("el-GR")

 'Redirect to same page to update all controls for newly selected culture
LocalTokenReplace.Language = "el-GR"
Response.Redirect(LocalTokenReplace.ReplaceEnvironmentTokens("[URL]"))


The problem is that the LocalTokenReplace is not recognized by visual studio. I can not find the namespace that I have to include in order to make this code to work. Does anyone knows which namespace should I include?
 
New Post
10/22/2010 10:29 AM
 
the localtokenreplace is an object so i don't know what namespace you need, but the default core tokenreplace is in the DotNetNuke.services.tokens namespace

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Language and In...Language and In...Language LinksLanguage Links


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out