
mxEditorJs
Block editor Editor.js for MODX 3 — content in blocks instead of TinyMCE/CKEditor


Save and load diagrams. Editor guide: user-guide.
mxEditorJs uses Canonical JSON + HTML snapshot:
modResource.content or TV textareaOnDocFormPrerender loads CSS/JS and fills window.mxEditorJsConfigMODx.loadRTE initializes Editor.js on #content and textarea.modx-richtext (TVs)content/get reads JSON from sidecarcontent/migrate, dry_run)syncToTextarea, debounce 500 ms): renderPreviewHtml)mxeditorjs_json / mxeditorjs_tv_{id}_jsonhookBeforeSubmit flushes JSON to hidden fieldsOnBeforeDocFormSave → ContentRepository / TvContentRepository.save(JSON)content_version incrementsServer HtmlRenderer is not called on this path. Client builds HTML in textarea.
POST content/save + content_json:
ContentValidatorHtmlRenderer → HTMLmodResource.contentUse for AJAX or custom integrations. TVs do not update modResource.content via connector.
content/migrate?dry_run=1 — block previewHtmlMigrator.convert() → save sidecar + update HTMLforce, confirmed — overwrite existing sidecarSupported: p, h1–h6, ul/ol, blockquote, img, table, pre/code, hr. Not migrated: embed, gallery, attaches, checklist.
| Action | Connector | Settings |
|---|---|---|
| Image / gallery upload | media/upload | image_mediasource, image_upload_path |
| Attachment upload | media/uploadFile | file_mediasource, file_upload_path |
| Folder browse | media/browse | type=image or type=file |
OnResourceDelete removes rows in mxeditorjs_content and related mxeditorjs_tv_content.
| Event | Purpose |
|---|---|
OnRichTextEditorRegister | Register mxEditorJs in RTE list |
OnDocFormPrerender | Config, assets, init |
OnBeforeDocFormSave | Save JSON to sidecar |
OnResourceDelete | Clean sidecar |