The module allows a site builder to change block level element tags or add classes within the block configurations. It accounts for both content and configuration blocks that are rendered using the block.html.twig template.

Installation

  • Enable the fences_block module like normal.
  • Navigate to block layout e.g(/admin/structure/block).
  • Click "Place block" or "Configure" on an existing block under the operations.
  • Next change any configurations under the "Fences Block" fieldset; then save.

Important notice for themes overwriting block.html.twig or block--*.html.twig

You may need to use the markup from the block--fences.html.twig file in your overrides, if you need additional functionality like block wrappers. See #3304737: block--fences.html.twig does (and should?) not overwrite theme overwrites
Otherwise, these features will not work.

Layout Builder notice

The module currently doesn't work for custom blocks in layout builder due to core issues. See #3117170: Make fences available for all block types in layout builder

Versions

2.x
2.x is the SemVer successor of 8.x-1.0-beta3, so you can and should upgrade to 2.x without fear, if you are or were using 8.x-1.0-beta3 already.

8.x-1.x
8.x-1.0-beta4 is a based on 8.x-1.0-beta2 (before changing (& fixing) the loading order made in this issue: #3303750: Add basic tests by this commit.
Thus provides a way for older sites to use the module in <= beta2 state without being affected by unwanted overrides and gives them time to fix such issues.
8.x-1.x will only receive security updates and might be deprecated sooner or later. Please plan your upgrade to 2.x branch, reading the "Important notice for themes overwriting block.html.twig or block--*.html.twig" above!

Dependencies:

Supporting organizations: 
Contributing time to work on this project
sponsored further development

Project information

Releases