Allowed blocks per content type

Created on 9 October 2024, 3 months ago

Problem/Motivation

For each content type it can be configured which gutenberg blocks should be active and which not. Since 3.0.x gutenberg saves only the blocks that should be active, no longer the ones that shouldn't be active. Therefore it is not possible to unregister them. All block libraries get loaded and there is no way to unregister them.

Steps to reproduce

Create a custom block, enable the module, deactivate that block for a content type and check if the block is still active on the edit page.

Proposed resolution

Add the block name to the corresponding library of a custom module in the my_module.gutenberg.yaml.

libraries-edit:
  block/name: my_module/block-edit

When loading all available libraries of the modules check if the block name is in the set of allowed blocks and only then load the library. To not break exisiting module also load the library if the block name is numeric.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024