Layout Builder block decorator is mainly an API module that provides a new plugin type which allows wrapping and decorating blocks added in layouts. Imagine for example the usecase where editors would want to add a wrapper element or a suffix to a block without touching code. This module makes this possible via the UI. More advanced decorators can be implemented as new Plugins of type BlockDecorator.

Features

  • A block decorator plugin that allows adding prefix and suffix markup to blocks.
  • Another decorator to add classes to a block's wrapping html element.
  • The API to implement custom decorators.

Post-Installation

  1. Once you installed the module as usual via the UI or Drush, create a node and edit its layout to add a new block of any type.
  2. On the layout edit form, click on the contextual links of the added block and select Decorate block.
  3. On the form that open in the tray, select the decorator plugin you want to apply on the block and configure it on the form that appears once you selected it.

Additional Requirements

This mode requires the Layout Builder module which ships with Drupal core.

Supporting organizations: 

Project information

Releases