Hello Nauman,
As you can see from the PageGroup definition it goes to its first page. This means that it will redirect to its first subpage instead of opening its own content.
There are three options
1.When the page does not exist in the current language version - show a user friendly label that says the page does not exists in this language
2. Bind the language bar control depending on the page language - you need to create a custom control to switch between the versions
sample code
3. Modify your SiteMap control to detect the page language and page redirect
sample code
protected void Page_Load(object sender, EventArgs e)
{
RadMenu1.DataBind();
IList<string> allLangs = new List<string>();
CultureInfo info = System.Threading.Thread.CurrentThread.CurrentUICulture;
CmsSiteMapNode node = SiteMap.CurrentNode as CmsSiteMapNode;
if (node.ParentNode.HasChildNodes && node.Parent.PageType == CmsPageType.Group)
{
var manager = new CmsManager();
var p = (ICmsPage)manager.GetPage(node.PageID);
IDictionary<int, IPageContent> lngVersions = p.LanguageVersions;
foreach (var key in lngVersions.Keys)
{
string pageLang = GetLanguage(key);
allLangs.Add(pageLang);
}
foreach (SiteMapNode siteMapNode in node.ParentNode.ChildNodes)
{
CmsSiteMapNode cmsNode = siteMapNode as CmsSiteMapNode;
int langID = cmsNode.CmsPage.LangID;
foreach(string k in allLangs)
{
bool ex = (langID.ToString() == k);
if (ex)
{
// make response redirect to the proper version
}
}
}
}
}
private string GetLanguage(int culture)
{
string lang = culture.ToString();
if (culture == 127)
{
lang = "127";
return lang;
}
else
{
lang = "2";
return lang;
}
}
Kind regards,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items.