Add the notion of a 'configured layout builder block' to solve a number of content-editor and performance pain points

Created on 8 June 2023, over 1 year ago

Problem/Motivation

There are currently a number of pain points with Layout Builder and how it interacts with the block plugin system as follows:

Proposed resolution

  • Per #3043330-95: Reduce the number of field blocks created for entities (possibly to zero) Add a 'legacy mode' settings flag to layout builder.
  • Enable this for existing sites.
  • With this enabled, field block deriver continues to run as is.
  • [#3043330 in it's current form can still proceed as it does improve the scenario for sites in legacy mode.
  • With legacy mode off, no field blocks are derived
  • Instead a new block plugin is made available per #3043330-95: Reduce the number of field blocks created for entities (possibly to zero) idea that basically encapsulates an entity type, bundle, fieldname and formatter/configuration for the field. The bundle field should support multiple values to allow re-use of a formatter across multiple bundles. Eg. you would not want to configure one instance of a 'short date' block for every node type.
  • With legacy mode off, a new config entity 'configured layout builder block' is available. This encapsulates
  • the functionality of layout builder browser (block order, block icon, configurable block category, configurable block label)
  • functionality of layout builder restrictions (which regions and sections it can be used in. At present Layout builder restrictions manages this on the view mode configuration but this is overwhelming and often results in a lot of merge conflicts for config YML files. Flipping the restriction management from being on the view display to on the block will reduce this pain and also simplify the UI of adding restrictions. The current UI in contrib is a series of expanding/collapsing details elements and modals to allow for all the possible blocks and sections.
  • Be sure to store the regions/section data in a way that would allow onDependencyRemoval to work (E.g. key sections/layouts by provider) and allow reacting to modules providing layouts being disabled.
  • Create a configured layout builder block map service, like we have for field map, that would be performant to query which blocks are available for which sections and regions given an entity context.
  • When configuring these 'configured layout builder block' config entities, allow the site builder to preconfigure and hide block config options from the content editor - this would allow preconfiguring the new block entity-field block from above to set formatter options - or for example configuring a views block
  • These 'configured layout builder block' config entities would also support adding the same field twice. E.g the example from above a 'short post date' and a 'long post date' could be preconfigured by the site builder.
  • Having a pre-defined set of 'configured layout builder block' entities would allow front-end teams to work with a known set of options to ensure that everything available had an appropriate front-end representation.

Remaining tasks

  • ✅ Discuss the pain points with product managers (@lauriii, @gabor, @ckrina)
  • ✅ Discuss the proposed resolution with subsystem maintainer (@tim.plunkett)
  • Implement the solution with test coverage
  • Reviews

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component
Layout builder 

Last updated 1 day ago

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

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

Comments & Activities

Production build 0.71.5 2024