kentico_radekm
-
12/15/2008 4:34:16 AM
RE:KB Article - Redirecting to default.aspx when another culture is clicked
Hello Darren.
We have updated this Knowledge base article, since previously it works for first level pages only.
To achieve requested functionality, please do following (in <project folder>/CMSWebParts/General/languageselectionwithflags.ascx.cs file):
Under “foreach (DataRow dr in ds.Tables[0].Rows)” in SetupControl() method please add:
///////// string YourDomainName = "http://www.mydomain.com/"; //Please change to requested domain name. Must be ended by slash "/"! string YourHomePageAspxFileName = "default.aspx"; // This is default value, please do not change /////////
Then please change this piece of code: if (this.ShowCultureNames) { // original code } else { // original code }
Like:
if (this.ShowCultureNames) { ltlHyperlinks.Text += "<a href=\"" + YourDomainName + YourHomePageAspxFileName + "?lang=" + dr["CultureCode"].ToString() + "\">"; ltlHyperlinks.Text += dr["CultureShortName"].ToString(); // Set surrounding div css class selectionClass = "languageSelectionWithCultures"; } else { ltlHyperlinks.Text += "<a href=\"" + YourDomainName + YourHomePageAspxFileName + "?lang=" + dr["CultureCode"].ToString() + "\">";
// Set surrounding div css class selectionClass = "languageSelection"; }
Now it works for all pages.
Best Regards, Radek Macalik
|