Modern CodeMirror 6 editor package for Evolution CMS 3.5.x. This package replaces the legacy CM5 plugin with a Composer‑installed, publishable, and extensible CM6 implementation.
- PHP ^8.3
- Evolution CMS ^3.5.2
- Composer 2.2+
composer require evolution-cms/ecodemirror "*"Register editor (optional auto‑set):
php artisan vendor:publish --tag=ecodemirror-configPublish assets:
php artisan vendor:publish --tag=ecodemirror-assets- Config (single source of truth):
core/custom/config/cms/settings/eCodeMirror.php
- Assets:
public/assets/plugins/eCodeMirror/dist/eCodeMirror.jspublic/assets/plugins/eCodeMirror/dist/eCodeMirror.css
These are overrides only. The canonical config is core/custom/config/cms/settings/eCodeMirror.php.
ecm_profileecm_theme_mode(auto/light/dark)ecm_themeecm_font_sizeecm_line_heightecm_line_wrappingecm_emmetecm_search
Key sections:
profiles— preset options + extensionscontexts— map context → profilethemes— light/dark theme mappingeditor— base options (font, line height, history/state, gutters, keymap)extensions— global feature togglesprotected_keys— options not overridable via params
Editor is wired into manager form events:
OnDocFormRenderOnTempFormRenderOnChunkFormRenderOnSnipFormRenderOnPluginFormRenderOnModFormRenderOnTVFormRenderOnRichTextEditorInit
Node is required for development builds. In production, use published public/dist.
npm install
npm run buildBuild output:
public/dist/eCodeMirror.jspublic/dist/eCodeMirror.css
- Assets are cache‑busted via
?v=<mtime>fallback. - Legacy CM5 plugin must be disabled when enabling eCodeMirror.
- Emmet is enabled via profile extensions (
emmet), lint currently provides JSON validation whenlintis enabled. - For resource content, eCodeMirror activates only when richtext is disabled (no RTE), matching legacy behavior.
- If you previously published
core/custom/config/cms/settings/which_editor.php, remove it to avoid forcing eCodeMirror as the RTE.
GPL-2.0