fsi/admin-news-bundle
Symfony bundle for managing news and announcements in FSI Admin backends, with CRUD for articles, publishing controls, and integration with existing admin panels. Adds a lightweight news section to Symfony applications.
Read this first: it's a Symfony bundle, not a Laravel package. fsi/admin-news-bundle ships a Bundle class, DI extension, XML/YAML service definitions, Doctrine ORM mappings and Twig templates. There is no service provider, no facade, no config publishing and no Illuminate dependency — composer require fsi/admin-news-bundle inside a Laravel app installs files that will never autoload into the container. Assess it as reference material (data model + admin UX for a news module) unless you are maintaining a legacy Symfony 2 app.
Minimal steps in its native habitat:
2015-03-12, so expect Symfony ~2.3–~2.7 constraints, PHP 5.x/7.0, Doctrine ORM 2.4-ish, and companions such as fsi/admin-bundle, fsi/datagrid-bundle, fsi/form-bundle, fsi/resource-bundle and the FSi Doctrine translation/behaviours bundles. Run composer why-not fsi/admin-news-bundle before anything else; on a modern Symfony this will fail immediately on version constraints.app/AppKernel.php next to FSiAdminBundle:
new FSi\Bundle\AdminNewsBundle\FSiAdminNewsBundle(),
(Verify the exact namespace/bundle name against composer.json autoload.psr-4 and the bundle class — FSi-era naming is inconsistent across their packages.)News / NewsCategory and point the bundle's class parameters at your subclasses.Where to look first: Resources/config/ (service ids and class parameters — this is the real API surface), Admin/, DataGrid/, Form/, then Resources/views/ for override points.
Entity inheritance over vendor edits. Never touch vendor/fsi/. Create AppBundle\Entity\News extends FSi\Bundle\AdminNewsBundle\Entity\News using Doctrine @MappedSuperclass or single-table inheritance, then override the bundle parameter:
parameters:
fsi_admin_news.entity.news.class: AppBundle\Entity\News
fsi_admin_news.entity.news_category.class: AppBundle\Entity\NewsCategory
Admin element extension. Subclass the bundle's admin element to add fields or change the grid, and register your subclass under the same service id (or a new id plus a tag) rather than modifying the bundle's service file:
services:
app.admin.news:
class: AppBundle\Admin\NewsAdmin
parent: fsi_admin_news.admin.news # or copy the definition
tags:
- { name: fsi_admin.admin }
DataGrid customisation. The FSi DataGrid is column-driven; add a column by extending the datagrid class and overriding buildDataGrid(), or by redefining the datagrid service. Typical day-to-day tweaks: a category filter, a "published" boolean column, a date formatter, and a thumbnail/attachment column.
Form extension. Extend the provided form type and add your own fields (image via a VichUploader-style listener, SEO meta, related articles). Add validation groups so published requires a publishDate.
Front-end rendering. Override templates the standard Symfony way rather than forking:
app/Resources/FSiAdminNewsBundle/views/News/list.html.twig
app/Resources/FSiAdminNewsBundle/views/News/show.html.twig
For the listing query, don't rely on the bundle's default grid — add a repository method scoped to published = true AND publishDate <= NOW(), ordered by date, with a hard setMaxResults().
Translation workflow. FSi's translation stack means each news item carries per-locale title/lead/body/slug. Pattern: one admin tab per locale, a sluggable listener per locale, and a locale-aware repository for the front end with a fallback locale.
Integration tips.
news and news_categories migration, an Eloquent model with published_at, a scope for published items, a sluggable trait, and a Filament/Nova resource for the admin. That is roughly a day's work and removes an unmaintained Symfony 2 dependency entirely.doctrine:schema:validate and silently in migrations. Run doctrine:mapping:info and doctrine:schema:validate after every model change, and hand-write migrations for inherited columns — doctrine:migrations:diff frequently misses them.%fsi_admin_news.entity.news.class%. Debug with php app/console debug:container --tag=fsi_admin.admin and debug:container fsi_admin_news.admin.news.FSi prefix casing. A mismatch silently renders the vendor template instead, which looks like "my changes did nothing".(slug, locale).published boolean plus publishDate is a scheduled-publishing model; make sure the front end filters on both, otherwise unpublished-but-dated items leak.assets:install/assetic:dump steps and remember cache:clear after parameter changes, since class parameters are baked into the compiled container.News model, because the admin layer is the part you'll want to modernise first.How can I help you explore Laravel packages today?