SaaS CMS has officially launched! Learn more now.

Class TemplateDescriptorAttribute

Attribute that describes a template

Inheritance
System.Object
TemplateDescriptorAttribute
Namespace: EPiServer.Framework.DataAnnotations
Assembly: EPiServer.Cms.AspNetCore.Templating.dll
Version: 12.0.3
Syntax
public sealed class TemplateDescriptorAttribute : Attribute

Constructors

TemplateDescriptorAttribute()

Default constructor

Declaration
public TemplateDescriptorAttribute()

TemplateDescriptorAttribute(Type)

Constructor for a modeltype

Declaration
public TemplateDescriptorAttribute(Type modelType)
Parameters
Type Name Description
System.Type modelType

Properties

AvailableWithoutTag

Gets or sets a value indicating whether the renderer should be available even when no specific tag is requested.

Declaration
public bool AvailableWithoutTag { get; set; }
Property Value
Type Description
System.Boolean

true if renderer is available without tag specified; otherwise, false.

Remarks

Default value is true if no Tags is specified else false.

Default

Gets or sets a value indicating whether this TemplateDescriptorAttribute is default.

Declaration
public bool Default { get; set; }
Property Value
Type Description
System.Boolean

true if default; otherwise, false.

Description

Gets or sets the description.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String

Inherited

Gets or sets a value indicating whether model types derived from ModelType automatically will be able to use the render.

Declaration
public bool Inherited { get; set; }
Property Value
Type Description
System.Boolean

ModelType

Gets or sets the model type for the described template should be registered for.

Declaration
public Type ModelType { get; set; }
Property Value
Type Description
System.Type
Remarks

This property is required if the template doesn't implement the IRenderTemplate<TModel> interface or if multiple descriptor attributes are added to the same template. If the template does implement the IRenderTemplate<TModel> interface, this type must match or be a subclass of the type passed to the interface.

Name

Gets or sets the name of the template.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Path

Gets or sets the path to the render.

Declaration
public string Path { get; set; }
Property Value
Type Description
System.String

Tags

The tags that this renderer support.

Declaration
public string[] Tags { get; set; }
Property Value
Type Description
System.String[]
Remarks

Use TagString instead if your project is CLS-compliant.

TagString

Gets or sets the render tags as a comma-separated list.

Declaration
public string TagString { get; set; }
Property Value
Type Description
System.String

The render tag.

Remarks

This can be used instead of Tags if your project is CLS-compliant.

TemplateTypeCategory

Gets or sets the template type of the renderer.

Declaration
public TemplateTypeCategories TemplateTypeCategory { get; set; }
Property Value
Type Description
TemplateTypeCategories

Extension Methods