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

Text Widget Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. Confirm the host app. You need Victoire core (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.
  2. Install:
    composer require victoire/text-widget
    
    The 2017 release pins old Symfony/CKEditor-era dependencies; expect Composer to fight you on PHP 7.2+ projects.
  3. Register the bundle in app/AppKernel.php (this era predates bundles.php):
    new Victoire\Widget\TextBundle\VictoireWidgetTextBundle(),
    
  4. Clear caches and check the Victoire widget picker in the backend — the text widget should appear as an available widget type.
  5. First use case: edit a page in the Victoire backend, drop the Text widget into a slot, write content in the WYSIWYG, save, and view the frontend page.

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.

Implementation Patterns

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.

Gotchas and Tips

  • Unmaintained since May 2017. No commits, 3 stars, 0 dependents. There is no upstream support: no security fixes, no Symfony 4+ compatibility, no PHP 7.4/8.x patches. Budget for owning it or pinning your stack.
  • Not a general text field. Its only value is the Victoire widget registration and the admin editing UX. If you're not on Victoire, use a plain entity field with a WYSIWYG instead.
  • Composer deadlock is the likely first failure. Old Symfony constraints will conflict with any modern dependency. Use --ignore-platform-reqs only as a diagnostic, not a fix.
  • Cache is aggressive. After overriding a template or changing widget config, clear app/cache — Victoire and Twig both cache template resolution, and stale widget output is the most common "my change did nothing" report.
  • Widget not appearing in the picker? Check bundle registration order relative to Victoire core, then the widget registry config, then cache. The widget silently missing is nearly always a registration problem, not a code problem.
  • Form type vs entity mismatch. If you subclass the entity, update the form type and the template together; Victoire resolves form fields by property name and will throw on missing mappings.
  • XSS is your responsibility. Raw HTML output with no sanitization is the default; do not expose the editor to untrusted authors without filtering.
  • Debugging hooks: Symfony profiler's Twig panel to confirm which template actually rendered (vendor vs override), and the Victoire backend's widget list to confirm registration. There are no logs specific to this bundle.
  • Exit strategy: because the widget is thin, the cheapest long-term path is to copy its entity + template into your own app bundle early, register it as a custom Victoire widget, and drop the dependency. That removes the abandoned-package risk without changing the editing UX.
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings