Class TemplateModelSelector
Selects which TemplateModel that should be used for a certain request.
Inheritance
Inherited Members
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
[ServiceConfiguration]
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 |
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 |
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.