Handler for dynamic SiteMap
Hi there.
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);
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 ==
true
).Where(p => p.WasPublished ==
true
).Get().OrderBy(p => p.Ordinal).ToList();
Hello,
Try using ThatAreForLanguage(CultureInfo language) method from your PagesFacade. Something like this
App.WorkWith().Pages().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend).Where(p => p.ParentId == rootNode.Id).ThatAreForLanguage(
"your culture here"
).....