Accent Fields Long text

Rich text

HTML from a rich editor, printed unescaped — with TinyMCE and TipTap as the two engines.


Formatted prose: the text data type edited through rich_text. Same data type as textarea, different promise — the value is HTML, and the template prints it unescaped (<%- %>). That is why this variant is a deliberate choice rather than a default: you are granting the field markup.

What is stored

HTML from the editor. The field is the trust boundary here, not the template — a rich-text field is a decision that this content may carry tags, made once at declaration time instead of at every print site.

Declaring one

Label Body
Key body
Data type text
Editor rich_text
Setting richTextEngine — see below
<div class="prose"><%- cms.asset.content.body %></div>

The two engines

The editor ships with a choice, set per field, because the right answer depends on what the field's existing content already contains:

Engine What it does Choose it when
TinyMCE (default) HTML-tolerant — keeps what it is given the content uses tables, classes, or inline styles that must survive
TipTap schema-constrained — keeps headings, lists, links, basic marks and drops the rest you want clean, predictable markup and can accept the pruning

Only the non-default is stored: a field with no richTextEngine setting is TinyMCE, which is the conservative default on purpose — switching an existing field to TipTap means its next save is judged by TipTap's schema, and markup outside that schema does not come back.

When not to use it

  • Plain paragraphstextarea. Rich text hands authors a formatting toolbar; if formatting is not wanted, do not offer it.
  • Layout — a rich-text field is not a page builder. Sections and components are the template's job; prose that carries layout is layout the template cannot reach.