Skip to content

Replace Textarea of your project with CKEditor components. File upload is already included

Notifications You must be signed in to change notification settings

ZenSide/CKEditorBundle

Repository files navigation

ZenSide CKEditor Bundle

Replace textarea with CKeditor.

Come configured with working Image Upload & Media Embed support

1.Add Bundle to AppKernel

public function registerBundles()
{
    $bundles = array(
        ...
        new ZenSide\CKEditorBundle\ZenSideCKEditorBundle(),
    )
}

2.Add route to routing.yml

zenside_ckeditor:
    resource: "@ZenSideCKEditorBundle/Resources/config/routing.yml"

3.Add initialisation to your layout

{% include 'ZenSideCKEditorBundle::ckeditor_init.html.twig' %}

4.Change selector used (optional)

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'} %}

  1. 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'} %}

4.File Upload configuration (optional)

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"

5.Change CKEditor configuration (optional)

You can import (after previous include) your own config.js file to overide default bundle configuration

About

Replace Textarea of your project with CKEditor components. File upload is already included

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published