https://github.com/code-wheel/jsonapi-frontend-layout
Layout Builder add-on for jsonapi_frontend: exposes /jsonapi/layout/resolve for true headless rendering.
https://github.com/code-wheel/jsonapi-frontend-layout
decoupled drupal headless jsonapi layout-builder
Last synced: about 18 hours ago
JSON representation
Layout Builder add-on for jsonapi_frontend: exposes /jsonapi/layout/resolve for true headless rendering.
- Host: GitHub
- URL: https://github.com/code-wheel/jsonapi-frontend-layout
- Owner: code-wheel
- License: gpl-2.0
- Created: 2026-01-02T23:49:29.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2026-06-12T21:45:19.000Z (16 days ago)
- Last Synced: 2026-06-12T23:20:40.619Z (16 days ago)
- Topics: decoupled, drupal, headless, jsonapi, layout-builder
- Language: PHP
- Homepage: https://www.drupal.org/project/jsonapi_frontend_layout
- Size: 28.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# JSON:API Frontend Layout Builder
[](https://github.com/code-wheel/jsonapi-frontend-layout/actions/workflows/drupal-module.yml?query=branch%3Amaster) [](https://github.com/code-wheel/jsonapi-frontend-layout/actions/workflows/semgrep.yml?query=branch%3Amaster) [](https://codecov.io/gh/code-wheel/jsonapi-frontend-layout) [](SECURITY.md)
`jsonapi_frontend_layout` is an optional add-on for `jsonapi_frontend` that exposes a normalized Layout Builder tree for true headless rendering.
## What it does
- Adds `GET /jsonapi/layout/resolve?path=/about-us&_format=json`
- Internally calls `jsonapi_frontend`’s resolver so aliases, redirects, language negotiation, and access checks behave the same
- When the resolved path is an entity rendered with Layout Builder, the response includes a `layout` tree (sections + components)
## Install
```bash
composer require drupal/jsonapi_frontend_layout
drush en jsonapi_frontend_layout
```
## Usage
```http
GET /jsonapi/layout/resolve?path=/about-us&_format=json
```
The response matches `/jsonapi/resolve` and adds a `layout` object when applicable:
- `layout.sections[]` includes `layout_id`, `layout_settings`, and normalized `components[]`
- Supported component types (MVP): `field_block`, `extra_field_block`, `inline_block`
## Notes
- This module is intentionally read-only and mirrors `jsonapi_frontend` caching behavior (anonymous cacheable; authenticated `no-store`).
- For rendering, you still fetch the resolved `jsonapi_url` (entity) and any referenced block content via JSON:API.
## Security & caching
- Treat `/jsonapi/layout/resolve` like part of your JSON:API surface (rate limit at the edge).
- For origin protection + rate limiting guidance, see `jsonapi_frontend`’s `MIGRATION.md` (Security hardening section).