AI OnAI Off
You can try something like this:
var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>(); var startPage = contentLoader.Get<StartPage>(ContentReference.StartPage); var published = contentLoader.GetChildren<PageData>(startPage.ContentLink) // skip container pages .Filter(new FilterTemplate()) // skip unpublished pages .Filter(new FilterPublished()) // ... .ToList();
Hi
Im using EpiServer CMS 9 and trying to get all published pages using this line of code.
EPiServer.Filters.FilterPublished.CheckPublishedStatus(content, PagePublishedStatus.Published)
However I'm getting an error saying that FilterPublished does not contain a definition for CheckPublishedStatus.
My Question:
How do I get the published pages only.
Please use above line of code when providing an answer.
Thanks