Skip to content

Commit

Permalink
MINOR tidy up README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewandante committed May 22, 2016
1 parent 2ac0c3c commit cdb8d28
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');

```

Expand All @@ -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');

```

Expand Down

0 comments on commit cdb8d28

Please sign in to comment.