Option to group reusable blocks together

Created on 15 December 2023, 11 months ago
Updated 1 September 2024, 3 months ago

Problem/Motivation

We were asked to simplify the choosing of reusable blocks so each bundle would not get its own details, but instead, all reusable blocks would show up under one detail area. I have a patch that will do this by adding a setting to group reusable blocks, but by default this is turned off and operates the way the module originally was written.

Steps to reproduce

1. Add some reusable blocks of different types into `/admin/content/block`
2. Make sure the settings in Layout Builder Browser are set to "Automatically add reusable content blocks by bundle" for each of the different bundle types added in step 1.
3. Enter layout builder on a node and scroll down to the bottom and notice that each bundle type gets its own details pane.

Proposed resolution

Add in a setting on the settings page to "group reusable blocks together" and use that logic in the BrowserController to switch how the blocks appear. If checked, group the blocks into one group. If unchecked (default), the module operates the same as it did before.

Remaining tasks

Upload patch (forthcoming), and testing.

User interface changes

Yes:
1. Settings form - add a checkbox form element
2. If checked, the layout builder browser picker will show reusable blocks in one group instead of multiple

API changes

None.

Data model changes

Yes, a new config setting: `group_reusable_blocks_together`

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States codechefmarc

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

Comments & Activities

  • Issue created by @codechefmarc
  • πŸ‡ΊπŸ‡ΈUnited States codechefmarc

    Uploading patch

  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States codechefmarc
  • πŸ‡ΊπŸ‡ΈUnited States vinmassaro

    Bumping as we've been using @codechefmarc's patch in production for awhile now, but would like maintainer review. Thanks!

  • Status changed to Needs work 3 months ago
  • πŸ‡¨πŸ‡ΏCzech Republic milos.kroulik

    I tried to use the patch, but it results in an error on adding a new block to LB section, because I've missed instructions in "Steps to reproduce". There needs to be a better error handling for case, when there is no reusable content block of type selected in "Automatically add reusable content blocks by bundle" checkboxes.

Production build 0.71.5 2024