
- MODX 3
- PHP 8.2


mxeditorjs).The plugin on OnDocFormPrerender starts the editor when the content field or a richtext TV appears.
Save via resource form (primary path):
renderPreviewHtml) to the textarea and hidden fieldsmodResource.content / TVOnBeforeDocFormSave writes JSON to sidecarThe form does not call connector content/save. Use that for AJAX and custom integrations. Details: Flows.
which_editor = mxEditorJs, this TV uses the same block editor.TV JSON is stored in mxeditorjs_tv_content. HTML lands in the TV textarea on save.
After save, main resource content exists in two forms:
modResource.content for the siteIn the template:
[[*content]]{$_modx->resource.content}Editor.js TVs use TV placeholders ([[*my_richtext_tv]] or Fenom). The site always receives ready HTML.
Convert existing HTML in the content field to Editor.js:
resource_id, optionally dry_run=1 (preview), then confirmed=1 to overwritedry_run the response includes preview (blocks) and blocks_count. On success: migrated, blocks_count, overwritten, htmlAfter confirmed, migration writes the sidecar and an HTML snapshot to modResource.content (HtmlRenderer, same as content/save). [[*content]] on the site updates without saving the form again.
Form Tabs column: "inputTVtype": "richtext". MIGX maps the type to migx + which_editor → migxmxeditorjs. The value is HTML inside the row JSON. No sidecar. Call MxEditorJsFlush before the window submits.
The block set is defined by mxeditorjs.profile or mxeditorjs.enabled_tools. See System settings.
{resource_id})0 = no limit)<img> in the HTML snapshot. See System settingsGallery HTML is built on save: client renderPreviewHtml or server HtmlRenderer on content/save and content/migrate. Markup:
<figure class="mxeditorjs-gallery mxeditorjs-gallery--fit">: grid (Fit)<figure class="mxeditorjs-gallery mxeditorjs-gallery--slider">: horizontal scroll (Slider)gallery-front.css loads only in the manager (form preview). The site does not load it automatically.
Add styles in the template or theme:
<link rel="stylesheet" href="/assets/components/mxeditorjs/css/gallery-front.css">Or copy rules from assets/components/mxeditorjs/css/gallery-front.css into theme CSS.
Embed blocks output <div class="mxeditorjs-embed"><iframe ...></iframe></div>. @editorjs/embed services are set in mxeditorjs.ts (services section), not via system settings. Add a service in source. See Architecture.