Provides a CodeMirror-powered field for pleasant editing of raw HTML code.
- SilverStripe 3.0
- Put the module into the root folder of your SilverStripe installation.
- Run /dev/build?flush=all
- Run /admin/?flush=all
Example for replacing SilverStripe's built-in TinyMCE editor with CodeMirror:
<?php class HtmlPage extends Page { function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab('Root.Main', 'Content'); $fields->addFieldToTab('Root.Main', $html_editor = HtmlField::create('Content', 'HTML Content')); $html_editor->setRows(20); return $fields; } }
- This field can not be used in frontend forms.