Table of Contents

Class RegisterPageTemplateAttribute

Namespace
Kentico.PageBuilder.Web.Mvc.PageTemplates
Assembly
Kentico.Content.Web.Mvc.dll

Registers a page template definition to be used within the system.

public sealed class RegisterPageTemplateAttribute : RegisterComponentAttribute, IPreInitAttribute
Inheritance
object
Attribute
RegisterPageTemplateAttribute
Implements
Inherited Members
Extension Methods

Constructors

RegisterPageTemplateAttribute(string, string, Type, string)

Registers a simple page builder page template using a view.

public RegisterPageTemplateAttribute(string identifier, string name, Type propertiesType = null, string customViewName = null)

Parameters

identifier string

Unique identifier of the page template definition.

name string

Name of the registered page template.

propertiesType Type

Type of the registered page template properties model. The type needs to implement the IPageTemplateProperties interface.

customViewName string

Custom view name for the registered page template. If not specified, the default system view name in format '~/Shared/PageTemplates/_{identifier}' is used.

Properties

ContentTypeNames

The content types this page template is registered for. If not specified, the registered page template is available for all page content types and IPageTemplateFilter must be implemented in order to scope the page template.

public string[] ContentTypeNames { get; set; }

Property Value

string[]

Remarks

Make sure to provide unique identifier for the page template definition from the start. This identifier is used within the page configuration and any further change can lead to incorrect configuration load. Consider specifying identifier in format 'CompanyName_ModuleName_PageTemplateName', e.g. 'Kentico_Content_LandingPageTemplate'.

Methods

PreInit()

Registers the page template definition during application pre-initialization.

public override void PreInit()