trassd / contao-grounding-pages
Integrates Grounding Pages (Standard v1.6) into Contao: one record = one entity (parent + child table), embedded as a content element, full schema.org ontology and exactly one standard-compliant JSON-LD graph per page (GEO/AEO).
Package info
github.com/avhulst/TrassdGroundingPages
Type:contao-bundle
pkg:composer/trassd/contao-grounding-pages
Requires
- php: ^8.3
- contao/core-bundle: ^5.7
- spatie/schema-org: ^3.10 || ^4.0
- symfony/dependency-injection: ^7.4
- symfony/http-foundation: ^7.4
- symfony/http-kernel: ^7.4
Requires (Dev)
- contao/contao-rector: dev-main
- contao/easy-coding-standard: ^6.13
- contao/manager-plugin: ^2.13
- contao/test-case: ^5.7
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^12.4
- rector/rector: ^2.0
- shipmonk/composer-dependency-analyser: ^1.8
- symplify/easy-coding-standard: 13.2.3
This package is auto-updated.
Last update: 2026-08-23 05:41:29 UTC
README
Deutsche Version: README_DE.md.
Integrates Grounding Pages according to the Grounding Page Standard v1.6 (https://groundingpage.com/) into Contao. A Grounding Page is a factual, clearly structured knowledge entry per entity — written for humans and AI/answer engines (GEO/AEO). The bundle provides a back end data model, a front end element and exactly one standard-compliant JSON-LD document per page.
Concept
- One record = one entity. A parent table holding the entity's governance data and a sortable child table holding the content sections.
- Embedded into the page. The complete Grounding Page is placed as a content element inside an article and renders within the normal page layout (header, footer, theme).
- Full v1.6 ontology (18 entity classes mapped to schema.org, fallback
Thing), extensible via a free-text field for arbitrary@typevalues.
Requirements
- PHP
^8.3, Contao^5.7 spatie/schema-org(^3.10 || ^4.0) — provided by the Contao core
Installation
composer require trassd/contao-grounding-pages
vendor/bin/contao-console contao:migrate --no-interaction
vendor/bin/contao-console contao:symlinks # publishes the front end CSS
vendor/bin/contao-console cache:clear
Creating a Grounding Page (back end)
Under Content → Grounding Pages, create an entity:
- Entity: name, alias, language, entity type, optional custom schema.org type.
- Definition & distinction: canonical definition, segment, “not to be confused with …”,
external identity URLs (
sameAs, e.g. Wikidata/Wikipedia/LinkedIn). - Governance: publisher, maintainer, status, version, publication date, last verified, a changelog and a correction/contact path.
Below that, add any number of drag-and-drop sortable sections. The chosen section type reveals the matching input fields:
| Section type | Row fields |
|---|---|
| Fact grid | Label · Value |
| Timeline | Year · Event |
| Defined terms | Term · Definition |
| FAQ | Question · Answer |
| Sources | Title · URL (+ identifiers: Label · Value) |
The page header (name, definition, distinction, governance) is always rendered from the entity's main data — it is not a separate section.
Embedding into a page (front end)
- In any article, insert a content element of type “Grounding Page” (group Includes) and select the desired Grounding record.
- The page outputs the complete Grounding Page within the normal layout (header, human notice,
sections, standard footer). The JSON-LD is placed automatically in the
<head>, as arecanonical, the meta description andhreflangfrom the Contao layout.
For a dedicated facts page, simply create a normal Contao page (e.g. /facts/<name>) and place
this single element on it.
Multilingual
Via separate Contao language trees (the Contao standard): one page per language holding the
element that points to the matching-language record (e.g. cern and cern-en). The record's
language field determines inLanguage; the hreflang links are provided by Contao through the
language trees automatically.
JSON-LD (schema.org)
Each page produces one graph containing a WebPage whose mainEntity is the resolved main
entity (e.g. Organization, Person, Product). sameAs, facts (additionalProperty),
DefinedTerm and FAQPage nodes are generated from the sections. Output runs through Contao's
response context, so the <script type="application/ld+json"> ends up in the <head> — even when
the element sits in the middle of the page content. Verifiable with the Schema.org validator.
Extensibility
- Arbitrary
@typead hoc: fill the Custom schema.org type field — it takes precedence over the standard mapping and the matching schema.org node is generated (otherwiseThing). - New ontology class: add a case to
src/Enum/GroundingEntityType.phpwith its mapping to a schema.org type — it then automatically appears in the back end select and in the JSON-LD.
Styling
The bundled CSS (public/grounding.css) uses Bootstrap CSS variables (--bs-*) with neutral
fallback values and therefore adopts your theme's colours automatically. All classes are prefixed
with grounding-page and can be overridden in the theme. The Twig templates live under
contao/templates/grounding/ and can be overridden per project.
Accessibility (WCAG 2.x AA / BFSG)
Semantic markup (article/section/dl/ol/time, a clean heading hierarchy, aside role="note" for the notice box), theme-consistent contrasts and a responsive layout.
Development
composer all # Rector (dry-run) → ECS → PHPStan → depcheck → PHPUnit
Individually: composer ecs (auto-fix), composer phpstan, composer rector, composer depcheck,
composer tests.