presta/cms-ckeditor-bundle
Integrates the CKEditor WYSIWYG editor into PrestaCMS, a Symfony-based content management system. This bundle wires rich text editing into CMS pages with configurable toolbars and editor options, installed via Composer and enabled in the Symfony kernel.
This is a Symfony 2 bundle, not a Laravel package — there is no service provider, no php artisan vendor:publish, and no config/*.php file. If you are coming from Laravel, translate the concepts first: AppKernel::registerBundles() is your provider list, app/config/config.yml is your config/, and php app/console is php artisan.
Minimum viable path for an inherited PrestaCMS project:
presta/cms and sonata-project/media-bundle are already installed and working. If SonataMediaBundle is not serving images yet, stop and fix that before touching CKEditor.composer require presta/cms-ckeditor-bundle --ignore-platform-reqs inside a php:5.6-cli or php:7.1 container rather than fighting it on PHP 8.app/AppKernel.php, after Sonata and PrestaCMS:
new Presta\CMSCKEditorBundle\PrestaCMSCKEditorBundle(),
app/config/routing.yml — the file browser and page-link picker are HTTP endpoints, not inline JS. If you skip this, the "Browse Server" and "Insert page link" buttons appear to do nothing.php app/console config:dump-reference presta_cms_ckeditor is the fastest way to see the accepted keys; the bundle's DependencyInjection/Configuration.php is the authoritative source if the dump is unhelpful.Form-level integration (the main pattern). Replace TextareaType with the bundle's CKEditor form type on your content fields. Because the type wraps CKEditor config, treat config as data: define two or three named toolbar profiles in config.yml (e.g. minimal, full) and select one per form field, rather than maintaining different YAML files per admin class.
SonataMedia round-trip. The editor does not store images itself — it browses and uploads through SonataMedia's media admin and inserts the resulting URL as <img src>. In practice this means:
reference, small, big), post-process the stored HTML at render time or override the media URL generation rather than asking editors to pick sizes manually.default while your templates expect a cms context is a recurring, silent breakage.Page links. The link plugin inserts internal URLs to other CMS pages. Two things to verify on day one:
_locale. Multi-site PrestaCMS installs often need the link provider service overridden to keep links host-agnostic.Customising behaviour. Use Symfony's standard override points, not forks:
app/Resources/PrestaCMSCKEditorBundle/views/.app/config/services.yml (or a compiler pass) to swap the filebrowser or link provider.web/ and add it via extraPlugins in the toolbar config. Run assets:install --symlink in dev so the plugin's JS resolves.Wrapping for a future migration. Put your own form type alias in front of the bundle's type (e.g. app.form.type.richtext extending it) and reference only that alias in admin classes. When you migrate to an actively maintained editor bundle, you change one service definition instead of every admin class.
This package is archived with 2 stars and 0 dependents. There will be no security fixes, no CKEditor upgrades, and no compatibility work. Treat it as a frozen dependency of a legacy application, not as a library to build on. Do not introduce new features through it.
Version lock is the first real problem, not the editor. Expect failures on PHP 7.2+ and anything Symfony 3+, typically from removed/renamed DI extension APIs and old getRequest() session patterns. Budget container time; do not attempt a "quick upgrade" of this bundle in place.
XSS is your responsibility. The editor produces raw HTML with permissive CKEditor 4 allowedContent defaults, and templates will render it with |raw. Sanitise on save (HTMLPurifier or your framework's sanitiser) with an explicit tag/attribute allowlist. Do not rely on the toolbar configuration to constrain what gets stored — a pasted payload bypasses toolbar buttons entirely.
Silent failures are almost always routing or context. If "Browse Server" opens an empty dialog or a 404, check in this order: the bundle's routes are imported, the filebrowser URL in config matches the imported route name, the Sonata media context exists. Use the browser network tab; the PHP logs often show nothing because the request never reaches your app.
Config is JSON-encoded into the page. Toolbar and plugin config is a PHP array serialised into the rendered JS. A stray quote or apostrophe in a toolbar label breaks the whole editor init with a console error and no PHP-side warning. Keep labels ASCII and simple.
Assets must be re-published on every deploy. CKEditor's JS and your plugin folders live in web/, installed via assets:install. Symlinked installs are convenient in dev but break on immutable deploy targets — use copy mode in production and include the asset step in your deploy script.
Debugging aids: config:dump-reference presta_cms_ckeditor for accepted keys, debug:container | grep ckeditor to find the actual service ids to override, and the browser console for anything involving toolbar plugins.
Migration target when you get the chance: an actively maintained CKEditor bundle (Ivory/FOS lineage) plus an explicit file-manager integration, with the SonataMedia browse endpoint reimplemented as a small custom plugin hitting your own JSON endpoint. The page-link picker has no drop-in replacement — plan to write that dialog yourself; it is usually a few hours of work and removes your last dependency on this bundle.
How can I help you explore Laravel packages today?