Define how block settings should be presented in the UI

Created on 30 October 2024, 11 months ago

Overview

Some blocks can be configured via block settings when placed into a page. We have at least two options for presenting the block settings to the user:

1. Use the settings form via the ::blockForm() method on the block plugin.

Pros: UI is the same as the existing Drupal block UI
Cons: Will this always work inside React? What if we want to map field values to block settings? (see πŸ“Œ Define `props` in the context of Block components Active )

2. Use the block config schema to build a settings form

Pros: Autogenerated forms will be easier to handle in the client
Cons: What if ::blockForm() allows dynamic values or uses other advanced features of forms?

One possible idea is to converge these two options: for fully validatable blocks, allow the block plugin to opt out of providing a form, and automatically generate it from the config schema instead. Then the Drupal core block UI will use same automatic form layout as the XB UI will use, but on the XB side we can augment the form elements if we need to (e.g. to provide dynamic field mappings).

Proposed resolution

?

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Config management

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

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

Comments & Activities

Production build 0.71.5 2024