Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cms Ckeditor Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. Confirm the parent stack exists first. This bundle is glue, not a standalone editor. It assumes 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.
  2. Install against the era-appropriate PHP. The last release is 2014-09-03 and targets PHP 5.3–5.6 / Symfony 2.3–2.8. On modern PHP use 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.
  3. Register the bundle in app/AppKernel.php, after Sonata and PrestaCMS:
    new Presta\CMSCKEditorBundle\PrestaCMSCKEditorBundle(),
    
  4. Import its routes in 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.
  5. Read the config reference before writing config. 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.
  6. First real use case: swap a content textarea in a Sonata admin form or a PrestaCMS block for the bundle's CKEditor form type, so editors can format text and insert images from the Sonata media library. That single change is what 90% of users of this bundle actually wanted.

Implementation Patterns

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:

  • A Sonata media context must exist and allow the extensions/sizes your editors will upload.
  • The URL written into the HTML is whatever Sonata returns at insert time. If your front end renders images through a specific format (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.
  • Pin the filebrowser upload target to that one context. Editors uploading into 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/host behaviour. If you run multiple domains or locales, confirm whether generated links are relative or absolute and whether they carry the current _locale. Multi-site PrestaCMS installs often need the link provider service overridden to keep links host-agnostic.
  • Broken-link drift. Stored links are plain URLs, so renaming a page's slug orphans every reference. If your project has long-lived content, add a redirect or a slug-history table outside this bundle — the bundle has no link-tracking of its own.

Customising behaviour. Use Symfony's standard override points, not forks:

  • Templates: app/Resources/PrestaCMSCKEditorBundle/views/.
  • Services: redefine the same service id in app/config/services.yml (or a compiler pass) to swap the filebrowser or link provider.
  • Extra CKEditor plugins: drop the plugin folder into 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.

Gotchas and Tips

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource