Class FilterContentForVisitor
A filter that removes any content that the current user does not have access to or that is not currently published or there is no defined render or not existed in current view language for the content
Inheritance
Implements
Namespace: EPiServer.Filters
Assembly: EPiServer.Cms.AspNetCore.Templating.dll
Version: 12.0.3Syntax
public class FilterContentForVisitor : Object, IContentFilter
Remarks
Even though the content is in published status this filter will also remove any content items that are not currently between its start and stop publish dates. Content items without a template will also be filtered.
Constructors
FilterContentForVisitor()
Initializes a new instance of the FilterContentForVisitor class.
Declaration
public FilterContentForVisitor()
Remarks
By default filter to return content that is Published, has Read access rights and there is a valid renderer.
FilterContentForVisitor(FilterPublished, FilterAccess, FilterTemplate)
Initializes a new instance of the FilterContentForVisitor class.
Declaration
public FilterContentForVisitor(FilterPublished filterPublished, FilterAccess filterAccess, FilterTemplate filterTemplate)
Parameters
Type | Name | Description |
---|---|---|
FilterPublished | filterPublished | The filter implementation used to assess the publish status for a content item. |
FilterAccess | filterAccess | The filter implementation used to assess the access rights for a content item. |
FilterTemplate | filterTemplate | The filter implementation used to assess whether the content item has a template or not. |
See Also
FilterContentForVisitor(TemplateTypeCategories, String)
Initializes a new instance of the FilterContentForVisitor class using a default set of filters.
Declaration
public FilterContentForVisitor(TemplateTypeCategories templateTypeCategories, string tag)
Parameters
Type | Name | Description |
---|---|---|
TemplateTypeCategories | templateTypeCategories | The template type categories set on the FilterTemplate filter. |
System.String | tag | The tag used to select template set on the FilterTemplate filter. |
Remarks
The default set of filters will check that content is Published, has Read access rights
and there is a valid render for the specified templateTypeCategories
.
See Also
Methods
Filter(IList<IContent>)
Filters the specified contents.
Declaration
public virtual void Filter(IList<IContent> contents)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<IContent> | contents | The contents. |
Filter(Object, ContentFilterEventArgs)
Event handler that applies the filter for contents.
Declaration
public void Filter(object sender, ContentFilterEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The class/instance that initiated the Filter event. |
ContentFilterEventArgs | e | The ContentFilterEventArgs argument containing the event data. |
ShouldFilter(IContent)
If the content should be filtered.
Declaration
public bool ShouldFilter(IContent content)
Parameters
Type | Name | Description |
---|---|---|
IContent | content | The content. |
Returns
Type | Description |
---|---|
System.Boolean | True if the filter will remove the page; otherwise false. |