November Happy Hour will be moved to Thursday December 5th.

Class TemplateModelSelector

Selects which TemplateModel that should be used for a certain request.

Inheritance
System.Object
TemplateModelSelector
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.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class TemplateModelSelector

Constructors

TemplateModelSelector()

Declaration
public TemplateModelSelector()

Methods

GetDefault(IEnumerable<TemplateModel>)

Gets the default template from the templates collection.

Declaration
public virtual TemplateModel GetDefault(IEnumerable<TemplateModel> templates)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TemplateModel> templates

The collection of templates to be evaulated.

Returns
Type Description
TemplateModel
Remarks

The default template is selected according to the following priority order. If an MVC template and a Web Form template are found at the same priority level the MVC renderer is returned.

GetDefault(IEnumerable<TemplateModel>, IList<DisplayChannel>)

Gets the default template from the templates collection.

Declaration
public virtual TemplateModel GetDefault(IEnumerable<TemplateModel> templates, IList<DisplayChannel> activeChannels)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TemplateModel> templates

The collection of templates to be evaulated.

System.Collections.Generic.IList<DisplayChannel> activeChannels

The active channels.

Returns
Type Description
TemplateModel
Remarks

The default template is selected according to the following priority order. A TemplateModel that has a tag that matches an active channel i s preferred. If an MVC template and a Web Form template are found at the same priority level the MVC renderer is returned.

GetDefault(IEnumerable<TemplateModel>, IList<DisplayChannel>, Boolean)

Gets the default template from the templates collection.

Declaration
public virtual TemplateModel GetDefault(IEnumerable<TemplateModel> templates, IList<DisplayChannel> activeChannels, bool filterOnAvailableWithoutTag)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TemplateModel> templates

The templates.

System.Collections.Generic.IList<DisplayChannel> activeChannels

The active channels.

System.Boolean filterOnAvailableWithoutTag

if set to true all templates that has AvailableWithoutTag set to false will be filtered away.

Returns
Type Description
TemplateModel
Remarks

The default template is selected according to the following priority order. A TemplateModel that has a tag that matches an active channel i s preferred. If an MVC template and a Web Form template are found at the same priority level the MVC renderer is returned.

SelectTemplate(IEnumerable<TemplateModel>, Boolean)

Gets the default template from the templates collection.

Declaration
public virtual TemplateModel SelectTemplate(IEnumerable<TemplateModel> templates, bool filterOnAvailableWithoutTag)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TemplateModel> templates

The collection of templates to be evaulated.

System.Boolean filterOnAvailableWithoutTag

if set to true all templates that has AvailableWithoutTag set to false will be filtered away.

Returns
Type Description
TemplateModel
Remarks

The default template is selected according to the following priority order. If an MVC template and a Web Form template are found at the same priority level the MVC renderer is returned.

Extension Methods