Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Conditional Layouts

Layout Builder Boolean lets you configure True/False versions of a Layout Builder section. You can configure which field operates as the "switch", deciding whether the True regions or False regions should render.

The module has a deriver that automatically generates a "Boolean" version of any Layout plugin that is installed on the site. It does not modify the existing Layouts; these are completely new plugins.

Layout Builder Boolean is most useful for configuring entity displays for entities that have optional fields. This module is not likely useful for configuring one-off layout overrides. That is, it's more useful for site building than for content authoring.

Example Use Case

Consider an article content type that has an optional entity reference field field_related_articles that can hold Related Articles. If a content author does not hand-pick any Related Articles, it would be nice to render a View of related articles.

1. Add the Section

2. Configure the Switch Field

3. Add Blocks to True/False Regions

This module is intended to play nice with popular contributed modules such as Layout Builder Styles.

Since this module potentially generates many new Layout plugins, Layout Builder Restrictions would be advised.

There is a core issue about making Condition plugins available for blocks that are added to Layout Builder.

#2916876: Add visibility control conditions to blocks within Layout Builder

Once that lands, Layout Builder Boolean could be replicated using custom Condition plugins (or Entity Field Condition) and a lot of careful configuration in Layout Builder. And that core feature will allow a lot additional tricks that Layout Builder Boolean does not allow.

Layout Builder Boolean solves a relatively simple case, but requires minimal configuration and no custom code. Layout Builder Boolean also provides the true/false UX, which may be an appealing feature even after Layout Builder blocks can have conditions configured.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jul 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.0-alpha6 Pre-release Jul 5, 2024