Skip to content

RichText Field

The site's own visual editor, inside a block.

The type appears only when MODX has an editor

It is added to the field type list only if an editor is installed and switched on (use_editor plus which_editor). With no editor there is nothing to render, so the type is simply absent from the list — there is no setting to turn it on.

Settings:

SettingWhat it does
Field heightIn pixels, 400 by default

The stored value is HTML, so print it as is:

html
<div class="article">{$content}</div>

Only CKEditor and TinyMCE are flushed before saving

The window submits over Ajax by reading the DOM, so no native submit event fires and an editor never syncs itself. PageBlocks calls CKEditor's updateElement() and TinyMCE's save() right before serialising the form.

An editor without either API will save whatever the textarea held before you started typing — that is, nothing. If a third-party editor loses everything on save, this is why.

The type is offered to the translators.

© PageBlocks 2019-present