netzbewegung / nb-headless-content-blocks
Connects together EXT:headless and EXT:content_blocks
Package info
github.com/Netzbewegung-Backend/nb_headless_content_blocks
Type:typo3-cms-extension
pkg:composer/netzbewegung/nb-headless-content-blocks
Requires
- friendsoftypo3/content-blocks: ^1.2.3 || ^2.0
- friendsoftypo3/headless: ^4.5 || ^5.0 || dev-master
- typo3/cms-core: ^13.4 || ^14.3
Requires (Dev)
- b13/container: ^3.1 || ^4.0
- bnf/phpstan-psr-container: ^1.1
- friendsofphp/php-cs-fixer: ^3.22
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpcov: ^10
- typo3/coding-standards: 0.9.0
- typo3/testing-framework: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-08 21:27:16 UTC
README
EXT:nb_headless_content_blocks
Connects EXT:headless and EXT:content_blocks: it converts Content Block records into JSON-compatible arrays for headless frontends — with a stable, test-frozen JSON contract.
Documentation: docs/README.md — start with Getting started. Changes are tracked in the CHANGELOG.
What it does
- Converts every Content Block field type to JSON without extra
configuration: richtext via
parseFunc_RTE, links as{url, target, type, title, config, attr}, files as{id, alt, title, publicUrl}, categories, collections, relations, FlexForms, date times, and more — see the JSON contract. - Field identifiers (not database columns) as JSON keys, alphabetically sorted — stable for frontend consumers.
- Declarative image variants: responsive thumbnails per field via an
optional
headless.yamlin the Content Block, overridable per site via TypoScript — no PHP needed. - Extensible conversion pipeline: register your own normalizers and field value transformers via DI tags.
- Escape hatches: per-block headless.php, sub data processors, and a PSR-14 event (deprecated).
- Support for EXT:container via the
nb-container-jsonprocessor.
Installation
composer require netzbewegung/nb_headless_content_blocks
Include the Site Set "Headless Content Blocks" in your site's
config.yaml:
sets: - nb-headless-content-blocks/headless-content-blocks
You are ready to go — the walkthrough with an example response lives in Getting started.
Development
Setup, tests and contribution rules live in CONTRIBUTING.md; machine-oriented onboarding (testing gotchas, TYPO3 version switching) in AGENTS.md.
License
GPL-2.0-or-later