This project is not covered by Drupal’s security advisory policy.
This module provides a Drupal Action to replace a specific region within a node's overridden Layout Builder layout with the content from the corresponding region in the content type's default Layout Builder layout. It's designed for efficiently updating or resetting common sections across multiple nodes.
Features
The "Layout Builder Action Region Replace" module introduces a powerful Drupal Action that allows site administrators and developers to manage Layout Builder regions with greater control and efficiency.
Basic Functionality:
- Provides a configurable Drupal Action that can be applied to nodes.
- This action targets a specific region in a node's Layout Builder layout (that has overrides) and replaces its components with the components from a specified region in the default Layout Builder configuration for that node's content type and view mode.
Unique Features:
- Targeted Region Replacement: Unlike reverting the entire layout, this module allows for the precise replacement of a single region's content.
- Synchronization with Default Layout: Easily propagate changes made in a default layout's specific region (e.g., a shared header, footer, or sidebar promo) to multiple nodes that have overridden their layouts.
- Bulk Operations: While the module itself provides the action, it can be seamlessly integrated with tools like Views Bulk Operations (VBO) to apply the region replacement to many nodes at once.
When and Why Would Someone Use This Module?
- When you have a common section (e.g., a promotional banner, contact information block, standardized call-to-action) defined in a default Layout Builder layout, and you need to ensure this section is consistently updated or restored across many nodes that might have other layout customizations.
- To revert a specific, customized region on multiple nodes back to its standard appearance as defined in the default layout, without affecting other customized regions on those nodes.
- After updating a shared block or component in a default layout's region, use this action to push that update to all relevant nodes.
Use Cases:
- Site-wide Banner Updates: A marketing team updates a promotional banner that appears in a specific region (e.g., "Top Banner Region") in the default layout for "Article" nodes. Use this action to push the new banner to all existing articles, even if their main content layouts are customized.
- Standardized Sidebar Content: Ensure all "Product" pages display the latest "Related Products" block in their sidebar region by replacing that region's content with the one from the default "Product" layout.
- Resetting a Region: If content editors have overly customized a specific section (e.g., a "Reusable Information" region) on several pages, an administrator can use this action to quickly reset that region back to the default content for those pages.
Post-Installation
Once installed, the "Layout Builder Action Region Replace" module makes a new Drupal Action available. Here's how it generally works and how to configure it:
1. Action Availability: The action "Replace LB region to default from default Layout Builder View" will be available in contexts where Drupal actions can be applied to nodes (e.g., on the `/admin/content` page if using Views Bulk Operations, or programmatically).
2. Action Configuration:
Before the action can be used effectively, it (or an instance of it, if used with VBO for example) needs to be configured. The configuration involves two key settings:
- Path to Region in Default View (
region_source): This tells the module where to copy the components from. It refers to the default Layout Builder layout for the node's content type and view mode (usually "Full content"). The format is<section_delta>.<region_name>. For example,0.contentwould refer to the "content" region in the first section (delta 0) of the default layout. You can find these deltas and region names by inspecting the default layout configuration for the content type. - Path to Region in node layout (
region_destination): This tells the module where to paste the components to in the node that is being processed. It refers to the specific node's overridden layout. The format is the same:<section_delta>.<region_name>. For example,1.sidebar_firstwould target the "sidebar_first" region in the second section (delta 1) of the node's specific layout.
Example: If your default "Article" layout has a banner in the first section's "header" region (0.header), and you want to replace the content of the first section's "header" region in individual article nodes, both source and destination might be 0.header. If the structure differs, adjust accordingly.
3. Executing the Action:
- The action will only affect nodes that use Layout Builder and have layout overrides (i.e., they are not using the "default" layout directly).
- When executed on a node, the module will:
- Load the components from the specified
region_sourcein the default layout. - Remove all existing components from the specified
region_destinationin the target node's layout. - Add the copied components to the
region_destinationin the target node's layout. - Save the node, creating a new revision.
- Load the components from the specified
- Status messages will indicate success or any issues encountered (e.g., node not using Layout Builder, region not found).
You typically wouldn't go to a dedicated configuration page for the module itself, but rather configure the action when you set it up for use (e.g., when adding it as a bulk operation in a View).
Additional Requirements
This module requires the following Drupal core modules to be enabled:
- Node: As the action operates on node entities.
- Layout Builder: As the module's core functionality is to manipulate Layout Builder sections and regions.
It is compatible with Drupal core versions ^10 or ^11.
Recommended modules/libraries
- Views Bulk Operations (VBO): This module is highly recommended if you intend to apply the "Layout Builder Action Region Replace" action to multiple nodes simultaneously. VBO allows you to select multiple nodes from a View and apply an action (like this one) to all ofthem.
Similar projects
While there are many modules that enhance Drupal's Layout Builder, the "Layout Builder Action Region Replace" module offers a very specific functionality: targeted region replacement via a Drupal Action.
- Other modules might offer broader layout management tools, layout presets, or block visibility controls. However, this module is focused on the precise task of synchronizing a single region's content from a default layout to overridden layouts.
- Modules like "Layout Builder Symmetric Translations" or "Layout Builder Kit" provide different sets of enhancements for Layout Builder. This module's uniqueness lies in its action-based approach to region content replacement.
If you know of other modules that offer very similar direct region content replacement via an action, please feel free to suggest them for comparison.
Supporting this Module
If you find this module useful, please consider supporting its development. (Link to your support page/platform).
Community Documentation
Currently, there is no additional community documentation. If you create a walkthrough or demo, please share it!
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 editing experience, Developer tools, Site structure
- Ecosystem: YMCA Website Services (former Open Y) Community Edition
- Created by podarok on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.


