friendsofvictoire/redactor-widget
A Laravel package that provides a Redactor rich-text editor widget for your admin forms, letting content editors write and format HTML with a familiar WYSIWYG interface.
First, calibrate expectations: this is not a Laravel package. friendsofvictoire/redactor-widget is a Symfony bundle (WidgetRedactorBundle) that plugs the Imperavi Redactor WYSIWYG into Victoire DCMS, a Symfony‑based "business page" CMS. If your project is Laravel, there is nothing here to leverage — the integration surface (AppKernel, DI tags, Doctrine entities, Twig) simply doesn't exist. The realistic audience is a Symfony dev inheriting a Victoire 1.x/2.x site.
Minimal path:
composer require friendsofvictoire/redactor-widget
Then, in a Victoire app:
app/AppKernel.php (new Victoire\Widget\RedactorBundle\WidgetRedactorBundle()).app/config/config.yml under Victoire's widget list so it shows up in the page-template editor's widget picker.php app/console cache:clear and php app/console assets:install --symlink (plus assetic:dump if the app still uses Assetic).Where to look first, in this order:
WidgetRedactorBundle.php — how the bundle declares itself and its DI extension.Entity/Widget.php — the persisted fields (this is the widget's schema).Form/ — the back-office editing form.Resources/views/show.html.twig — the front-end rendering, i.e. the only file you'll touch 90% of the time.First real use case: a per-page rich-text block (editorial copy, a legal notice, a promo banner body) that content editors can change without a deploy, scoped to a single business page template rather than a global block.
Treat the bundle as scaffolding, not as a dependency. With a 2016 last release, 2 stars and zero dependents, the highest-value pattern is: read this bundle, copy its structure into an in-house WidgetMyThingBundle, and own the code. Victoire widget bundles are small and uniform, so this is a few hours of work and removes the abandoned-package risk entirely.
Adding a field to the widget. The standard Victoire widget loop is:
Entity/Widget.php (e.g. $content, $alignment).Resources/views/show.html.twig.Anything you skip in that chain fails quietly rather than loudly, so do all four in one pass.
Template override instead of fork. Victoire resolves widget templates through the bundle path, so you can override rendering per project without touching vendor:
app/Resources/VictoireWidgetRedactorBundle/views/show.html.twig
Use this for markup changes (wrapping the output in your grid classes, adding a <div class="rte">), and keep the vendor copy pristine so composer update doesn't nuke your work.
Composition with the page template. The widget is bound to a business page template, so the workflow is: define the template once with the widget placeholder, then every page created from that template gets its own editable rich-text instance. Avoid duplicating the widget across templates — editors end up maintaining N copies of the same copy block.
Rendering pattern. Rich text needs raw output, escaped nowhere:
{% if widget.content is not empty %}
<div class="rte">{{ widget.content|raw }}</div>
{% endif %}
Guard on emptiness — Victoire will happily render an empty widget and leave you with stray margins and empty <div>s.
Pair it with a valuer/business-entity field when the copy should be data, not layout. If the text belongs to the page's model (a product description, a page subtitle), it usually belongs on the business entity, not in a widget. Widgets are for editorial slots; fields are for entity data. Mixing them is the most common architectural mistake in Victoire projects.
The dependency graph is the first blocker. A 2016 Symfony bundle will typically pin symfony/* to ~2.3|~3.0, Twig ~1.x, and PHP >=5.3. On PHP 8 or Symfony 4+ Composer will refuse to resolve. There is no maintained branch — expect to either run the legacy app in Docker with the original PHP version, or vendor the widget code in and modernize the annotations/Twig syntax yourself.
No security maintenance. Redactor (Imperavi) had a commercial license for v2+ and the JS shipped here is a decade old. If you keep it, sandbox the editor, keep it back-office-only, and sanitize the HTML on output if the editor role isn't fully trusted (|raw on editor input is an XSS vector — in Victoire that's usually acceptable since editors are staff, but check your threat model).
Assets are the #1 "it renders but doesn't work" cause. The widget can appear in the picker while the Redactor JS 404s, leaving you with a plain textarea. Check assets:install, assetic:dump, and whether the bundle publishes to web/bundles/victoirewidgetredactor/. Look at the network tab before touching PHP.
Widget missing from the picker: almost always (a) bundle not enabled in AppKernel, (b) widget not registered in the Victoire config, or (c) stale cache. cache:clear fixes a surprising share of Victoire oddities — do it before debugging config.
Widget renders blank: the show.html.twig path or the valuer is wrong. Confirm the template is actually being resolved (Twig debug / {% dump %} in dev) rather than silently falling back.
Doctrine mapping drift. Older Victoire bundles mix annotation and XML mapping across versions. After any edit to Entity/Widget.php, run doctrine:schema:validate and diff the generated SQL before migrating; widget tables have inherited columns from the Victoire base widget entity, and a naive schema:update can drop them.
Extension points worth knowing: template override (above), a form-type extension if you need to add a field without forking the entity, and service decoration if you need to post-process content on render. There are no events or hooks specific to this bundle — it's thin by design, so don't go looking for a plugin API.
Migration recommendation. For a new project, don't adopt this. Use a plain Victoire text/HTML widget, or wire a maintained CKEditor/TinyMCE field into a custom widget bundle. For an existing install, pin the exact commit in composer.json, copy the widget into your own namespace, and delete the dependency — at 2 stars and no releases since 2016, that's the only durable way to "leverage" it.
How can I help you explore Laravel packages today?