Custom Language Selector
Hi Waqar,
I reviewed your diagram but it is somehow confusing - under Nen (in English) you have a page in Arabic and under Nar (in Arabic) you have an English page. This is not quite possible or I don't understand your idea? Also, do you need a walkthrough on how to go back 2 pages in the hierarchy (you could use the Parent property of PageNode). Please give us more details.
Regards,Hello Waqar,
Well I'm not sure how exactly you try to retrieve the AR page but if you know the UrlName of the Nar page you could use this code to retrieve it:
var pageManager = PageManager.GetManager();
var page = pageManager.GetPageNodes().Where(p => p.UrlName == "Nar").FirstOrDefault();
Then you can retrieve a list of subpages of the Nar page with
var subPages = pageManager.GetPageNodes().Where(p => p.ParentId == page.Id);
and by cycling through then get to the "A" page.
Thanks for the reply,
I think the diagram is misleading you, So lets start with the simple question can you please provide the code for my custom language selector? Which should have same functionality as sitefinity language selector.
Hello Waqar,
We do not have a ready code for custom language selectors - please check these forum threads - they might be useful for you:
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/developing-with-sitefinity/custom-language-selector.aspx
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/developing-with-sitefinity/language-selector-and-url-rewriting.aspx