zenside/ckeditor-bundle

Replace textarea with CKeditor. Come configured with working Image Upload & Media Embed support.

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Language:HTML

Type:symfony-bundle

dev-master / 0.x-dev 2015-11-27 10:55 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:42:29 UTC


README

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