Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Conditional Rendering

No security coverage Under active development 66 sites

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.

Drupal 9–11

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.

Activity

Tracked releases
4
Tracked since
Feb 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.2 Stable 9–11 Nov 8, 2024
1.0.1 Stable 9–11 Aug 6, 2024
1.0.0 Stable 9–10 Mar 8, 2024
1.0.x-dev Dev 9–11 Feb 2, 2024