Display Name attribute

API Reference: DisplayNameAttribute Class

The DisplayNameAttribute can be applied to page models, sections, content models, and content properties. The attribute specifies the display name of the object in the user interface of the back office application.

Usage

Decorate the page model class with the DisplayNameAttribute. Pass the display name in the attribute constructor.

Default Convention

If DisplayNameAttribute is not specified, the display name will be inferred from the object identifier. The name will be split into words on capital letters, so ContentPage would become Content Page.

Example

[DisplayName("RSS Feed")]
public class RssFeed: IPageModel
{
    [DisplayName("SEO Settings")]
    public SeoContent Seo { get; set; }

    // Display name will be 'Second Paragraph' by convention
    public ParagraphContent SecondParagraph { get; set; }
}

In this example the display name attribute is applied to a page model and a page section. The display name attribute can be applied to content models and properties in the same way.