Search by

formatz / contao-headless-cms-bundle

formatz

Contao Headless CMS Bundle

Package info

gitlab.com/formatz/contao-headless-cms-bundle

Issues

Type:contao-bundle

pkg:composer/formatz/contao-headless-cms-bundle

Statistics

Installs: 66

Dependents: 0

Suggesters: 0

Stars: 2

2.0 2026-11-16 11:47 UTC

This package is auto-updated.

Last update: 2026-11-20 08:29:01 UTC


README

Requirements

  • PHP 8.4 or newer
  • An up-and-running Contao 5.3 (LTS) or newer installation, with the news bundle

Installation

Install composer if you haven't already, enter this command in the main directory of your Contao installation:

composer require formatz/contao-headless-cms-bundle

Contao Content API is now installed and ready to use.

Usage

Once installed, the following routes are available:

/api/page?url=/about/team.html OR /api/page?id=5

Gets the page, including all articles and contents at the url or id.

Example | Example with newslist | Example with newsreader

/api/module?id=5

Gets the content of a module by id

Example (newsreader)

/api/content?id=5

Gets the content of a content element by id

Example | Example with image

All routes also take the additional lang parameter (e.g. ?lang=de). If you need to override the language.

Clear the cache of the headless application

When a page, an article, a content element, a news, a form, a FAQ or an event is saved in the back end, a POST request is sent to the headless application(s):

APP_CLEAR_CACHE_URL=https://app1.example.com/api/clear-cache,https://app2.example.com/api/clear-cache
APP_CLEAR_CACHE_KEY=secret

The token is sent in the X-Authentication-Token header, the body contains name=cmsCache_event and the id of the record. Several endpoints can be separated by commas. Errors are logged but never block the back end.

Development

composer install
vendor/bin/phpunit

Contribution

Bug reports and pull requests are very welcome :)

© Format-Z 2026