dalley-it / contao-catalogue
Catalog bundle providing RSCE-like schema-driven records with list/reader, filters, prev/next navigation, and multilingual linking.
Package info
github.com/dalley-it/contao-catalogue
Type:contao-bundle
pkg:composer/dalley-it/contao-catalogue
Requires
- php: ^8.1
- contao/core-bundle: ^5.3
- symfony/framework-bundle: ^6.4
README
Schema-driven catalogues for Contao 5.3++.
This bundle provides:
- Backend catalogue containers (similar to "archives")
- Backend records with schema-defined virtual fields stored as JSON
- Optional nested record items (rows/children)
- Frontend list and reader modules
- Filtering via an indexed taxonomy column
- Prev/next navigation in the reader (within the current filter context)
- tl_news-like language linking via
languageMain
The bundle is designed as a lightweight alternative to data-driven extensions, while keeping the editing experience close to Contao and DCA conventions.
Package and namespaces
- Composer package:
dalley-it/contao-catalogue - PHP namespace:
DalleyIt\ContaoCatalogue\... - Bundle class:
DalleyIt\ContaoCatalogue\DaitContaoCatalogBundle - Database tables:
dait_cc_*
Database tables
dait_cc_catalogue(catalogue container)dait_cc_record(records)data_jsonstores schema fieldsidx_taxonomyis used for filtering (single taxonomy value)idx_relation_idis a generic relation pointer (optional)
dait_cc_record_item(optional nested items for a record; supports nesting viaparent_id)dait_cc_dictionaryanddait_cc_dictionary_item(backend-managed option lists)
Schemas
Schemas are PHP files located in:
<project>/contao/catalog_schemas/<schema_key>.php
A schema file returns an array with (typical) keys:
fields: associative array of virtual field definitionsindexes: mapping of database index columns to JSON pathsitemTypes: optional definitions fordait_cc_record_item.type
An example schema is included:
contao/catalog_schemas/example.php
Dictionary-backed select fields
Use inputType => 'dictionarySelect' to populate a select widget from a dictionary.
You can define a dictionary key either:
- per field (
dictionaryKeyin the field definition), or - per catalogue (
dait_cc_catalogue.dictionaryKey) as a default.
Frontend modules
dait_catalogue_list(template:mod_dait_catalogue_list)- Optional taxonomy filter via
?taxonomy=<CODE>
- Optional taxonomy filter via
dait_catalogue_reader(template:mod_dait_catalogue_reader)- Reader parameter:
?item=<alias|id> - Prev/next navigation respects the current
taxonomyfilter
- Reader parameter:
Installation
Install via Composer:
composer require dalley-it/contao-catalogue
Run the database update in Contao Manager / Install Tool.
Configuration workflow (recommended)
- Create a dictionary (optional) to hold taxonomy values.
- Create a catalogue (
dait_cc_catalogue) and set:schema_keyjumpTo(reader page)dictionaryKey(optional, for taxonomy select options)
- Add records to the catalogue.
- Place
dait_catalogue_liston the list page anddait_catalogue_readeron the reader page.
Extending
This bundle intentionally keeps the indexing model minimal (idx_taxonomy, idx_relation_id).
If you need additional filterable fields, extend the record table with more index columns and map them via indexes in your schema.