AI OnAI Off
Hi
The equivalent call using LoaderOptions would be:
var eventPages = contentRepository.GetChildren<EventPage>(startPage.EventsRoot, new LoaderOptions{ LanguageLoaderOption.FallbackWithMaster() });
You can still use static methods on LanguageSelector if you prefer that, they will "under the hood" create a LoaderOptions instance as above. So basically is the static methods on LanguageSelector now convenient methods to create LoaderOptions with different LanguageLoaderOption.
However if you write tests for your code I would suggest to use LanguageLoaderOption instead since they are easier to handle in that scenario and the static methods of LanguageSelector.
The main reason LoaderOptions where introduced (as a replacement to ILanguageSelector) was to make it possible to pass in other LoaderOption instances as well. (Currently there is also a ProjectLoaderOption and others might come).
Hello,
We recently upgraded our project to Episerver 8, and I read about the changes to content loading here: http://world.episerver.com/documentation/Items/Upgrading/EPiServer-CMS/8/Breaking-changes/changes-to-content-loading-in-cms-8/
In one part of our code, we need to find pages of a certain type, including unpublished and archived pages. The only way we figured out how to do that was by adding the LanguageSelector.Autodetect(true) parameter, like so:
Is this still the recommended way to get pages regardless of publish status? I thought that the LanguageSelector was deprecated, but it still seems to be working in the GetChildren method anyway.
/John