ongr/content-bundle
ONGR ContentBundle is a Symfony bundle for managing structured content and reusable content blocks within ONGR’s Elasticsearch-oriented stack. It helps organize content types, pages, and templates for CMS-style sites, but is a small package that may need extra setup and documentation review.
Treat ongr/content-bundle as a legacy Symfony 2.x / Elasticsearch 1.x–2.x asset, not a greenfield dependency. It was the domain layer of the ONGR e-commerce stack and it was built to be paired with ongr/elasticsearch-bundle, ongr/router-bundle, and ongr/filter-manager-bundle — all of which are equally archived.
Minimal steps:
Document/ namespace first. That is the actual public API: Category, Product, and Content Elasticsearch document classes with their properties, relations, and mapping annotations. Everything else (controllers, repositories, DI) hangs off those documents.DependencyInjection/ and Resources/config/ to see how the ES manager, repositories, and routers are wired. Since there is no Packagist documentation to lean on, the service definitions are your spec.ongr/elasticsearch-bundle for the manager/repositories, ongr/router-bundle if you want URL→document resolution, ongr/filter-manager-bundle if you want faceted category listings.Category and Product documents into ES via the ES bundle's ongr:es:index:create / bulk-index commands, then wire the bundle's category controller (or a thin subclass) to render a category page with its products. That exercises document mapping, relations, repository lookup, and rendering in one loop — which is the entire bundle in miniature.Expect no changelog, no upgrade path, and no support. Budget for vendoring or forking if you commit to it.
Extend the documents, don't edit the vendor ones. The intended workflow is to create your own AppBundle\Document\Product extends Ongr\ContentBundle\Document\Product, add fields (attributes, pricing, media), and remap the index in your config.yml under the ES manager's indexes key. This is how you customize mapping without forking.
Two indexing modes, use both. For day-to-day admin edits, register a Doctrine listener / ES event subscriber that reindexes a document when the underlying entity is persisted — cheap and immediate. For bulk backfills or mapping changes, use the ES bundle's console commands over the whole set. Never assume the index is current; the bundle does not enforce consistency.
Repositories are thin ES wrappers. Category/product lookup (find, bulk findByIds, and filter-manager-driven search) goes through the ES bundle's repository layer. For anything beyond ID lookup — pagination, sorting, aggregations — push the query down into ongr/filter-manager-bundle rather than hand-rolling ES queries in your controller.
Controller subclassing over reimplementation. The bundle ships controllers that resolve a document from the request (via the router bundle) and hand it to a template. Subclass them and override the template variable assembly if you need custom rendering. This keeps routing, locale handling, and 404 behavior intact.
Relationships are ID references, not object graphs. Categories reference parent categories; products reference categories; content references placement. Hydrate deliberately: a category listing page needs a second ES call (or a filter-manager aggregation) to load its products. Don't expect lazy loading.
Integration tip — route resolution is the connective tissue. If you use ongr/router-bundle, a URL resolves to an ES document, and the bundle's controllers consume that. If you don't, you'll be manually mapping slugs to documents, which is where most of the "why doesn't this feel like a CMS" friction comes from.
curl/Kibana before touching PHP.How can I help you explore Laravel packages today?