In my search for a multilingual sitemap handler to generate a Google acceptable sitemap XML file for our multilingual site, I started off with the SiteMap Handler from LeapFrog Interactive (BTW, Thanks to them for providing their source code!).
Of course, it did not work with SF 5.1 we have installed, and it did not seem to handle multilingual sites. In our case, we want the Sitemap to reflect the language version of our web site, so have a sitemap for English version of the site, and another one for the French version.
I am now able to display the "base" language sitemap - which is English, but for some reason, the alternate language does not seem to work.
I am getting the root node ID using this piece of code, then I recursively find all it's child pages.
PageNode rootNode = App.WorkWith().Pages().Get().Single(p => p.Id == SiteInitializer.FrontendRootNodeId);
The issue I have is no matter what I do, it only retrieves the English pages.
Is there a way to specify the language of the page we need to get?
I even tried with the following, then iterating through all the pagenodes, but I think I need to set the current thread's culture or something the like...but thread does not seem to be available at the Handler level...
List<PageNode> startingNode = App.WorkWith().Pages().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend).Where(p => p.ParentId == rootNode.Id).Where(p => p.AvailableCultures.Contains(CurrentLang)).Where(p => p.ShowInNavigation ==
).Where(p => p.WasPublished ==
).Get().OrderBy(p => p.Ordinal).ToList();
CurrentLang is a private property in the above example.
Your help is appreciated!