You created a form component using RichTextComponent, and it displays correctly in the form builder (edit page view) but not on the front-end (page).
The key issue lies in this line:
@Html.Kentico().RichTextEditorFor(m => m.Value, htmlAttributes, configurationName: "simple")
This line renders the Rich Text Editor (the editing UI) — but you don’t want an editor on the live site. You want to render the HTML content, i.e., the saved string stored in the DefaultValue.
Solution: Differentiate View vs. Editor
In your RichTextComponent.cshtml, update your Razor like this:
@model Kentico.Components.Web.Mvc.FormComponents.FormComponentViewModel<string>
@{
var htmlAttributes = new Dictionary<string, object>();
}
@if (Context.Kentico().PageBuilder().EditMode)
{
@Html.Kentico().RichTextEditorFor(m => m.Value, htmlAttributes, configurationName: "simple")
}
else
{
// Render the HTML content as-is
@Html.Raw(Model.Value)
}