Table of Contents

Class RegisterSectionAttribute

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

Registers a section definition to be used within Page builder feature.

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

Constructors

RegisterSectionAttribute(string, string, Type, string)

Registers a simple page builder section using a custom view.

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

Parameters

identifier string

Unique identifier of the section definition.

name string

Name of the registered section.

propertiesType Type

Type of the registered section properties model. The type needs to implement the ISectionProperties interface.

customViewName string

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

Remarks

Make sure to provide unique identifier for the section 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_SectionName', e.g. 'Kentico_Content_SingleColumn'.

Use this attribute when simple section is being developed and no custom controller is needed.

RegisterSectionAttribute(string, Type, string, Type)

Registers a simple page builder section using a view component.

public RegisterSectionAttribute(string identifier, Type viewComponentType, string name, Type propertiesType = null)

Parameters

identifier string

Unique identifier of the section definition.

viewComponentType Type

Custom view component type for the registered section.

name string

Name of the registered section.

propertiesType Type

Type of the registered section properties model. The type needs to implement the ISectionProperties interface.

Remarks

Make sure to provide unique identifier for the section 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_SectionName', e.g. 'Kentico_Content_SingleColumn'.

Use this attribute when simple section is being developed and no custom controller is needed.

Methods

PreInit()

Registers the section definition during application pre-initialization.

public override void PreInit()