Try our conversational search powered by Generative AI!

Interface ITemplateResolver

The template resolver is responsible to find what template to use for a certain type.

Namespace: EPiServer.Web
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public interface ITemplateResolver
Remarks

The template resolver can be extended using TemplateResolving and TemplateResolved events on ITemplateResolverEvents.

Methods

Resolve(Object, Type, TemplateTypeCategories, IEnumerable<String>)

Resolves what rendering template that should be used for the provided item given that it is of the provided template category.

Declaration
TemplateModel Resolve(object item, Type itemType, TemplateTypeCategories category, IEnumerable<string> tags)
Parameters
Type Name Description
System.Object item

The item of which type the template should be associated with.

System.Type itemType

in case item is null then type is used for resolving

TemplateTypeCategories category

The category of template type that should be returned.

System.Collections.Generic.IEnumerable<System.String> tags

The tags to use when selecting a template.

Returns
Type Description
TemplateModel

A TemplateModel object that contains information on the template.

Remarks

The template tags are treated as a prioritized list meaning a template with a tag matching a preceding tag will be preferred.

Extension Methods