victoire/text-widget
A simple, configurable text widget for Laravel dashboards and admin panels. Add customizable text or HTML blocks to your layouts with minimal setup, useful for notices, instructions, or quick reference content.
This is a single-purpose widget bundle for Victoire CMS, not a standalone package. It only makes sense inside a project that already runs Victoire; installing it on a vanilla Symfony app gets you an entity and a template that nothing renders.
Minimal path:
victoire/victoire or the split core packages) on Symfony 2.8/3.x. If your app is not already Victoire-based, stop here — this bundle is not a general "text field" library.composer require victoire/text-widget
The 2017 release pins old Symfony/CKEditor-era dependencies; expect Composer to fight you on PHP 7.2+ projects.app/AppKernel.php (this era predates bundles.php):
new Victoire\Widget\TextBundle\VictoireWidgetTextBundle(),
Where to look first in the repo:
Entity/WidgetText.php — the widget's data model (a content-style field plus inherited widget metadata).Resources/views/ — the rendering template; this is the file you will actually touch most.DependencyInjection/ and Resources/config/ — how the widget is wired into Victoire's widget registry.Template override, the normal day-to-day task. Do not edit files in vendor/. Override the widget template in your app's resource path (Victoire follows the standard bundle-override convention, e.g. app/Resources/VictoireWidgetTextBundle/views/Widget/Text/widget.html.twig). If you want wrapper markup, class hooks for CSS, or to pass the content through a filter, this is where you do it.
Sanitize on output. The widget stores editor HTML and the shipped template prints it raw. The safe pattern is to control what the editor can produce (restrict CKEditor's toolbar/allowed tags in Victoire's editor config) and treat stored content as trusted only because the editors are trusted. If non-admin users can edit, wrap the output with an HTML sanitizer (HTMLPurifier or similar) in your overriding template.
Extending the widget rather than forking it. If you need extra fields (subtitle, alignment, link), the Victoire-idiomatic move is to create your own WidgetTextExtraBundle that subclasses the entity and extends the form type, then render with your own template. Forking this bundle is only worth it if you also plan to maintain the Victoire integration.
Slot composition. Text widgets are almost always combined with other Victoire widgets in a page slot. Keep the widget template free of layout assumptions (no fixed widths, no outer <section> unless you own the slot template) so it composes cleanly with image/CTA widgets.
Per-locale content. Victoire's localization means the same widget entity can carry translated content. When overriding templates, don't hardcode strings in the widget markup; keep labels in the editor content or in translation files so the widget stays locale-agnostic.
Asset wiring. The bundle expects the Victoire editor stack (CKEditor assets) to be present. If the WYSIWYG doesn't load, the problem is almost always the host app's asset/editor bundle configuration, not this widget.
--ignore-platform-reqs only as a diagnostic, not a fix.app/cache — Victoire and Twig both cache template resolution, and stale widget output is the most common "my change did nothing" report.How can I help you explore Laravel packages today?