From cdb8d28505dd9b0d54666009086449b446c3ffe8 Mon Sep 17 00:00:00 2001 From: Andrew Aitken-Fincham Date: Sun, 22 May 2016 16:55:47 +1200 Subject: [PATCH] MINOR tidy up README.md --- README.md | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 219be6e..7375308 100644 --- a/README.md +++ b/README.md @@ -51,18 +51,18 @@ Using CodeEditorField in getCMSFields: ```php - $fields->addFieldToTab('Root.Content', $codeField = new CodeEditorField('ExtraTags', 'Extra tags')); - // set the field to use the full width of the CMS (optional, not included in screenshot) - $codeField->addExtraClass('stacked'); - - // set the height of the field (defaults to 8) - $codeField->setRows(30); - - // set the syntax mode to yaml (defaults to html) - $codeField->setMode('yaml'); +$fields->addFieldToTab('Root.Content', $codeField = new CodeEditorField('Configuration', 'Configuration')); +// set the field to use the full width of the CMS (optional, not included in screenshot) +$codeField->addExtraClass('stacked'); + +// set the height of the field (defaults to 8) +$codeField->setRows(30); - // optional - set theme (see codeeditorfield/thirdparty/ace/src-noconflict/theme-xxx.js files for available themes) - $codeField->setTheme('twilight'); +// set the syntax mode to yaml (defaults to html) +$codeField->setMode('yaml'); + +// optional - set theme (see codeeditorfield/thirdparty/ace/src-noconflict/theme-xxx.js files for available themes) +$codeField->setTheme('twilight'); ``` @@ -77,14 +77,13 @@ To replace the code editor in TinyMCE: ```php -// copy this into your project's getCMSFields (you can find this code in codeeditorfield/_config.php) - - HtmlEditorConfig::get('cms')->enablePlugins(array( - 'aceeditor' => sprintf('../../../codeeditorfield/javascript/tinymce/editor_plugin_src.js') - )); - HtmlEditorConfig::get('cms')->insertButtonsBefore('fullscreen', 'aceeditor'); - HtmlEditorConfig::get('cms')->removeButtons('code'); +// copy this into your project's getCMSFields +HtmlEditorConfig::get('cms')->enablePlugins(array( + 'aceeditor' => sprintf('../../../codeeditorfield/javascript/tinymce/editor_plugin_src.js') +)); +HtmlEditorConfig::get('cms')->insertButtonsBefore('fullscreen', 'aceeditor'); +HtmlEditorConfig::get('cms')->removeButtons('code'); ```