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
-
objectAttributeRegisterSectionAttribute
- 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
identifierstringUnique identifier of the section definition.
namestringName of the registered section.
propertiesTypeTypeType of the registered section properties model. The type needs to implement the ISectionProperties interface.
customViewNamestringCustom 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
identifierstringUnique identifier of the section definition.
viewComponentTypeTypeCustom view component type for the registered section.
namestringName of the registered section.
propertiesTypeTypeType 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()