Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Class FilterPublished

Filter to remove pages based on published status.

Inheritance
System.Object
FilterPublished
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Filters
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class FilterPublished : PageFilterBase, IPageFilter, 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
[Obsolete("Use default constructor instead (the IContentRepository parameter in this constructor is never used)")]
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(PageDataCollection)

Filters the specified pages.

Declaration
public override void Filter(PageDataCollection pages)
Parameters
Type Name Description
PageDataCollection pages

The pages 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

ShouldFilter(PageData)

If the page should be filtered.

Declaration
public override bool ShouldFilter(PageData page)
Parameters
Type Name Description
PageData page

The page that you want to check.

Returns
Type Description
System.Boolean

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

Overrides

Implements

Extension Methods