Skip to content

Instantly share code, notes, and snippets.

@hissy
Last active January 14, 2017 23:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hissy/8da3e9ffe9f3935d1be8 to your computer and use it in GitHub Desktop.
Save hissy/8da3e9ffe9f3935d1be8 to your computer and use it in GitHub Desktop.
Customizing the Redactor Editor in #concrete5
  1. Make application/src/Editor/RedactorEditor.php
  2. Override editor binding from application/bootstrap/app.php
<?php
Core::bindShared('editor', function() {
return new \Application\Src\Editor\RedactorEditor();
});
<?php
namespace Application\Src\Editor;
class RedactorEditor extends \Concrete\Core\Editor\RedactorEditor
{
protected function getEditor($key, $content = null, $options = array())
{
// Stop converting divs to paragraphs
$options['replaceDivs'] = false;
return parent::getEditor($key, $content, $options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment