API Reference: DefaultSectionAttribute Class

The DefaultSectionAttribute can be applied to content model classes. The attribute specifies the section in the user interface that properties of this model will be grouped in when they do not have a section specified explicitly. This reduces the need to apply SectionAttribute on each individual property.

If DefaultSectionAttribute is not specified on a content model, all properties that do not have a section specified explicitly will be grouped in a section named Content.

Usage

Decorate the content model class with the DefaultSectionAttribute. Pass the section display name in the constructor. All properties without a section defined will be grouped in this default section in the user interface. The attribute is not inherited, so if a default section is specified on a base class, it will not be automatically specified on derived classes.

Example

The following example demonstrates the usage of both the DefaultSectionAttribute and SectionAttribute.

[Page]
[DefaultSection("Basic Properties")]
public class SamplePage: IContentType
{
    // This property will appear in a section named 'SEO'.
    [Section("SEO")]
    public string Description { get; set; }

    // This property will appear in the default section named 'Basic Properties'.
    public string Summary { get; set; }

    // This property will be in the same section with the 'Description' property.
    [Section("SEO")]
    public SeoContent Seo { get; set; }
}