
Quick Start
Step 1. Installation
- Install CMX via Packages → Package Management (overview)
- Make sure the CMX plugin is enabled
- Reload the manager page; clear the MODX and browser caches if necessary
Step 2. Editor for Elements
which_element_editor = cmx.
Open a snippet, chunk, template, or plugin: the standard code field will become a CMX editor with syntax highlighting and a toolbar.
To temporarily switch back to another editor, change the value of which_element_editor. You do not need to uninstall CMX.
Step 3. Code in Resources
The context-specific values of use_editor and which_editor, as well as the resource's richtext property, are taken into account:
| Goal | Settings |
|---|---|
| CMX in the content field of all resources | use_editor = No. This also replaces <textarea> elements with the modx-richtext class |
| CMX only for resources without richtext | use_editor = Yes, which_editor empty or cmx, richtext disabled |
| TinyMCE / another RTE | use_editor = Yes, which_editor not cmx, richtext enabled for the resource |
| Textarea without CMX | use_editor = Yes, which_editor not cmx, richtext disabled |
Learn more: Integration.
Step 4. Verification
- Open a snippet: PHP syntax highlighting should appear
- In an HTML template, type
[[and wait for the element list, or press Ctrl+Space - Press Ctrl+Shift+P / Cmd+Shift+P: the command palette will open
- While holding Ctrl / Cmd, click the name of an existing snippet: it will open in a new tab
- Open the settings using the gear button and select a theme
Checklist
What's Next
- System Settings
- Integration: forms, MIME, TVs, drafts, and history
- Keyboard Shortcuts
