Overview
Rest block data modules intended to accomplish maximum Drupal’s potential in the fully decoupled applications.
It helps developers to design the decoupled applications layout from the Drupal’s block layout and expose layout structure along with block data through REST resources.
Features
- Manage your decoupled application’s components/ blocks from Drupal block layout structure as same as we do for Drupal templates.
- Since the Drupal page is composed of blocks, get all your page’s data in a single API request rather than multiple API requests or subrequests to avoid HTTP round trips and multiple Drupal bootstraps.
- Support for multilingual.
- Fully customizable.
- Easily register your custom blocks for Rest block data.
- While decouple applications designed for the end users, Drupal template is intact for Editors and Administrators.
- Supported for the other decoupled modules such as simple_oauth, json_api etc.
Requirements
Installation and Configuration
- Install rest_block_layout and menu_normalizer, rest_block_data.
- Enable rest_block_data module and it’s dependencies.
- Enable Block Layout resource (You may need RestUI).
- Grant required access for Block Layout resource in people -> permissions.
- Access the block layout data https://yourdomain.com/block-layout?_format=json&path=/ (Sample response attached as rest_block_data.txt).
Known problems and solutions
When you couldn’t see the data attribute in the block object which means that block doesn’t register for rest block data. Please refer hook_block_alter() and Drupal\rest_block_data\Plugin\Block\SystemBrandingBlock for how to register a block for rest block data by Drupal\rest_block_data\Plugin\Block\BlockInterface interface.
When you get Could not normalize object of type “X”, no supporting normalizer found error which means there is no normalizer for that type. Please refer here.
Please raise an issue for any further issues.
| Attachment | Size |
|---|---|
| rest_block_data.txt | 28.54 KB |
Project information
- Project categories: Decoupled, Developer tools
- Created by gkaruppusamy on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.

