Replace textarea with CKeditor.
Come configured with working Image Upload & Media Embed support
public function registerBundles()
{
$bundles = array(
...
new ZenSide\CKEditorBundle\ZenSideCKEditorBundle(),
)
}
zenside_ckeditor:
resource: "@ZenSideCKEditorBundle/Resources/config/routing.yml"
{% include 'ZenSideCKEditorBundle::ckeditor_init.html.twig' %}
By default all textarea
will be replaced. To filter it you can pass a css selector to the include call :
{% include 'ZenSideCKEditorBundle::ckeditor_init.html.twig' with {'selector':'textarea.ckeditor'} %}
- Change Stylesheet applied inside editor (optional)
You can overwrite the default styles of the ckeditor by giving your own stylesheet asset path to the init file
{% include 'ZenSideCKEditorBundle::ckeditor_init.html.twig' with {'contentsCss':'bundles/mybundlename/css/myStyleFile.css'} %}
By default, files uploaded are moved into /web/uploads/cke. You can change this with parameter ckeditor.upload_dir in parameters.yml. Note that this folder will be relative to /web folder (had to be visible from browser to be included in CKEditor visualisation).
// parameters.yml
parameters:
...
ckeditor.upload_dir = "/myuploaddir"
You can import (after previous include) your own config.js file to overide default bundle configuration