Twig Blocks adds a Twig function to render blocks in Twig by passing in the block machine name.
Usage
To render a block, call the function in your Twig template.
The simplest way to render block plugin is as follows.
{{ render_block('block_id') }}
Optionally you can pass block label and plugin configuration in the second
parameter.
{{ render_block('block_id', {label: 'Example'|t, some_setting: 'example', setting_array: {value: value}}) }}
Objective
There is another module that provides similar functionality but it also has an option to turn on and allow PHP execution in the Twig templates which I didn't want to add to my project. This is just a straight-forward function to render a block.
Supporting organizations:
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Content display, Developer tools
742 sites report using this module
- Created by adam_ on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
8.x-2.6
released 18 February 2026
Works with Drupal: ^8.8 || ^9 || ^10 || ^11
Install:
Development version: 8.x-2.x-dev updated 18 Feb 2026 at 14:21 UTC

