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

Layout Widget Laravel Package

friendsofvictoire/layout-widget

A PHP package from Friends of Victoire for adding reusable layout widgets to your projects. Define configurable widget areas, compose page layouts more cleanly, and render consistent blocks across templates with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

This bundle ships the Layout widget for Victoire DCMS — the widget that lets editors drop a multi-column container into a page and nest other widgets inside each column. It is a companion bundle, not a standalone library: it only makes sense if you already run Victoire on Symfony.

  1. Confirm your platform first. Victoire targets Symfony 2.8/3.x and PHP 5.6–7.x. Check your symfony/symfony and victoire/core constraints before adding anything; this package will not resolve on Symfony 4+.
  2. Install alongside Victoire, not before it:
    composer require friendsofvictoire/layout-widget
    
    If Composer fails to resolve, pin a version that matches the Symfony major you are on (^1.0 vs ^2.0), since the bundle's releases track Victoire's own.
  3. Register the bundle in app/AppKernel.php (or bundles.php if you are on a late 3.x):
    new FriendsOfVictoire\WidgetLayoutBundle\WidgetLayoutBundle(),
    
    Order matters — it must load after VictoireCoreBundle and VictoireWidgetBundle.
  4. Look here first: vendor/friendsofvictoire/layout-widget/Resources/config/ for the service definitions (the widget is auto-registered via a tag) and Resources/views/ for the Twig template that renders the grid. That template is the thing you will most likely override.
  5. First use case: open a page in the Victoire backend, add a slot/widget, pick Layout from the widget picker, and set the number of columns in the configuration form. Then drop existing widgets into the resulting column areas and verify they render on the front end.

If the widget does not appear in the picker, the bundle is registered but its widget service is not being collected — clear the cache (bin/console cache:clear --env=dev) and confirm the tag in the bundle's services.xml.

Implementation Patterns

Victoire widgets are services with a tag, rendered through a Twig function; the Layout widget is unusual because it contains other widgets. The patterns that matter day-to-day:

  • Slot → Layout → widgets. The normal authoring flow is: add a Layout widget to a slot, choose column count, then nest widgets into each column via the backend UI. The nesting is persisted as widget relations, so your only job on the front end is rendering the correct template chain.
  • Rendering. Front-end pages render via Victoire's widget Twig helper (typically the victoire_widget_render-style function). You rarely call the Layout widget directly — you render the business entity/page and Victoire walks the widget tree. Use the standard render helper on the page's business entity rather than hand-calling individual widgets.
  • Template overrides. Copy the bundle template into app/Resources/FriendsOfVictoireWidgetLayoutBundle/views/ (or your theme bundle) and adjust the markup. This is the supported extension point for changing the grid classes — Bootstrap, Foundation, CSS Grid, all achieved through the overridden template, not PHP.
  • Adding a fixed column variant. If you need a "2/3 + 1/3" or "sidebar" layout that editors can pick, the idiomatic approach is a thin subclass of the widget that returns a different form type (or a fixed template), registered in your own bundle's services with the same Victoire widget tag. Do this in an app bundle, never by editing vendor code.
  • Integration with custom widgets. Any widget you build for Victoire is nestable inside a Layout column as long as it renders through the same widget mechanism. Keep your custom widget templates free of page-level wrappers (<body>, global containers) — inside a column they inherit the layout's sizing.
  • Content modelling. Treat the Layout widget as presentation only: it should carry no business data of its own beyond column configuration. Keep editable content in the nested widgets so it stays queryable and reusable.

Gotchas and Tips

  • This package is effectively unmaintained. Zero stars and zero dependents is not a cosmetic detail — it means no one is filing or fixing bugs, and there is no migration path. Before adopting, check whether you can satisfy the Layout requirement with Victoire's own layout/slot features or a custom widget, and treat this bundle as a liability you inherit knowingly.
  • Hard Symfony coupling. It will not install on modern Symfony. If you are starting a project today, Victoire (and therefore this widget) is not a viable choice; this assessment only holds for existing Victoire installations.
  • The bundle does nothing without Victoire core. Installing it standalone and expecting a renderable layout widget is the most common early mistake. victoire/core and victoire/widget are the real dependencies; verify they are present and correctly configured first.
  • Asset/cache staleness. After overriding the template or changing column config, Victoire caches rendered widget output and compiled Twig. Clear both the Symfony cache and any Victoire page cache before concluding your override "didn't work."
  • Template override path is fragile. The bundle-name path in app/Resources/.../views/ must match the bundle's name exactly (FriendsOfVictoireWidgetLayoutBundle). A typo here silently falls back to the vendor template, which is a classic time sink.
  • Nesting depth and performance. Every nested widget adds render calls and a database lookup for the widget tree. Deeply nested Layout widgets (a layout inside a layout inside a layout) will slow page rendering noticeably; cap nesting depth in your editorial guidelines and, if needed, enforce it in a widget form constraint.
  • No upstream bugfixes. Because there is no active maintainer, fork it into your own VCS if you find yourself patching it — and vendor the fork via a vcs repository entry in composer.json rather than expecting a release.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums