Property Editors

Content model properties show up in the Redakt back office user interface as input fields for content managers. Every property has an associated property editor, which determines how the property input looks and behaves in the back office.

Configuration

For many properties, you will not have to do any configuration at all. By convention, Redakt selects the property editor that is most suitable for the property type. For example, a string type will result in a single line text property editor.

Only if you wish to change the behaviour of a property editor or use a different property editor altogether, you can do so by decorating the property with appropriate attributes. For example, in case of the string property type, you could configure a multiline text input, or use a rich text editor instead. See the lists below for more details on the standard property editors and attributes. The example below shows a few different property configurations.

public class SomeContent: IContentModel
{
    // Default single line text input.
    public string Title { get; set; }

    // Required multiline plain text input (textarea) with max length of 200 characters.
    [Required]
    [Multiline]
    [MaxLength(200)]
    public string Intro { get; set; }

    // Selects rich text editor, also default editor for HtmlString.
    [RichTextEditor]
    public string Body { get; set; }

    // Number editor; value not required.
    public int? Count { get; set; }

    // Number editor with 2 decimals and min/max value; value is required because the type is not nullable.
    [NumberEditor(Decimals = 2, Minimum = 0, Maximum = 10000)]
    public decimal Price { get; set; }

    // Select list with constant options and placeholder text.
    [SelectList("black:Black Tea", "green:Green Tea", "rooibos:Rooibos", "chai:Chai")]
    [Placeholder("Select some tea")]
    public string FavouriteTea { get; set; }
}

Standard Property Editors

Redakt CMS comes with a lare number of built-in property editors that should meet the needs of most websites. See the individual guides for features and how to configure them.

Property Editor Attributes

This is a list of all attributes that can be used to change property editor behaviour. The property editor guides discuss these attributes, but they are listed here as well for convenience. Most attributes can only be applied to a limited number of property editors. Some attributes are specific to a single property editor.

Custom Property Editors

If you need a different property editor from any of the standard ones, you can create your own property editor. This involves creating a user interface for the editor in Angular, and a small .NET class for editor definitions and settings.