This module allows you to control when content blocks appear in Layout Builder. You can set rules for each block to determine whether it should be displayed based on specific conditions, making your layouts dynamic and context-aware.
Conditional Content Block Rendering in Layout Builder
This module provides a solution for conditional rendering of content blocks when they are placed in Layout Builder.
It allows you to set rules for each block, determining when they should
be rendered based on the specific conditions.
Features
The basic functionality of this module is to provide a user-friendly interface for defining conditions under which certain content blocks will be rendered when used on the layout builder.
It is a simple approach that uses conditions to compare tokens against values.
This can be used to create dynamic, context-sensitive layouts. For example, you might use this module to show a specific block only to logged-in users or to display a block for users who meet certain criteria.
Post-Installation
After installing the module, when you create a new content block or edit an
existing one, you'll find a new section for defining rendering conditions.
You can add as many conditions as you need for each block, and the block will
only be shown or hidden based on the conditions you define.
Additional Requirements
This module requires Drupal core. No additional modules, libraries, or APIs are
required.
Recommended Modules
While not required, the Token module can
be used in conjunction with this module to show available tokens and provide
additional flexibility in defining rendering conditions.
Similar projects
There is a push to bring visibility control of blocks within Layout Builder to Drupal Core, but until then, this is a working solution to archive the same goal.
Ask your assistant about Conditional Rendering
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- layout_builder Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.