SaaS CMS has officially launched! Learn more now.

Class FilterPublished

Filter to remove pages based on published status.

Inheritance
System.Object
FilterPublished
Implements
Namespace: EPiServer.Filters
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public class FilterPublished : ContentFilterBase, IContentFilter

Constructors

FilterPublished()

Initializes a new instance of the FilterPublished class.

Declaration
public FilterPublished()
Remarks

Will create a filter with filter condition PagePublishedStatus.Published.

FilterPublished(IPublishedStateAssessor)

Initializes a new instance of the FilterPublished class.

Declaration
public FilterPublished(IPublishedStateAssessor publishedStateAssessor)
Parameters
Type Name Description
IPublishedStateAssessor publishedStateAssessor

The publish status validator used to validate the published state.

FilterPublished(PagePublishedStatus)

Initializes a new instance of the FilterPublished class with given filtering condition.

Declaration
public FilterPublished(PagePublishedStatus publishedStatus)
Parameters
Type Name Description
PagePublishedStatus publishedStatus

The published status that pages should have to remain after this filter has executed.

FilterPublished(IContentRepository)

Initializes a new instance of the FilterPublished class.

Declaration
public FilterPublished(IContentRepository contentRepository)
Parameters
Type Name Description
IContentRepository contentRepository

Properties

PublishedStatus

Gets or sets the filter condition to use.

Declaration
public PagePublishedStatus PublishedStatus { get; set; }
Property Value
Type Description
PagePublishedStatus

Methods

Filter(IList<IContent>)

Filters the specified pages.

Declaration
public override void Filter(IList<IContent> contents)
Parameters
Type Name Description
System.Collections.Generic.IList<IContent> contents

The content items that should be filtered.

Overrides
Remarks

Will remove all pages in e.Pages that do not fulfill the PublishedStatus criteria. If the page points to other page via PageShortcutType.FetchData PageShortcutType then the fetched page should fulfill the PublishedStatus criteria.

ShouldFilter(IContent)

If the content should be filtered.

Declaration
public override bool ShouldFilter(IContent content)
Parameters
Type Name Description
IContent content
Returns
Type Description
System.Boolean

True if the filter will remove the content; otherwise false.

Overrides

Implements

Extension Methods