Computer Magic Logo
Richtext editor

Sunday, June 7, 2015

Published by Aristotelis Pitaridis

The Richtext editor is a textarea control which allows the administrator to enter formatted multi-line text. Below we can see an example of creating a Richtext editor type property:

The My Richtext Editor property has the following appearance when we edit the document:

The toolbar of Richtext Editor can be modified by removing or adding icons. To do this select the Richtext editor data type from the Data Types tree located in Developer section.

In order to read the value as a strongly typed object we use the following code:

@{
    if (Model.Content.HasValue("myRichtextEditor"))
    {
        <p>@(Model.Content.GetPropertyValue<string>("myRichtextEditor"))</p>
    }
}

In order to read the value using dynamic properties we use the following code:

@{
    if (CurrentPage.HasValue("myRichtextEditor"))
    {
        <p>@CurrentPage.myRichtextEditor</p>
    }
}