Retrieve Default Language Version of a Page
Hello,
Our site will be localized, with several different languages. We currently have code to retrieve specific pages nodes by their url name.
Our current code looks like this:
this.PageManager.GetPageNodes().Where(n => n.UrlName == urlName).SingleOrDefault();
Hello John,
You can get the default backend language by using DefaultBackendLanguage property of Telerik.Sitefinity.Abstractions.AppSettings.
To get a page on a specific culture you should set the CurrentUICulture to the language you want to query.
Best wishes,
Ivan Dimitrov
the Telerik team
Thank you Ivan.
If we set the current culture in a control on the page, will that affect everything else on the page, or just calls after that point in the context of the control?
We basically want to "override" the current language (culture) setting to grab a different language version of the page (actually, a page node) without affecting anything else on the page. Will this technique work for that?
Thanks again!
John G
Hello John,
You can set the CurrentUICulture, but after you execute your logic you should return it back the the initial value, otherwise the other data on the page might be affected.
All the best,
Ivan Dimitrov
the Telerik team