Make Gutenberg entity-type-agnostic

Created on 4 August 2020, almost 4 years ago
Updated 6 June 2024, 20 days ago

Problem/Motivation

Gutenberg is currently written primarily with Node entities in mind.
I think the module should be flexible enough to work with most (content) entity types e.g. Taxonomy terms.

As part of this work, I think we should move away from storing all the configurations in gutenberg.settings.yml and moving towards storing them as third_party_settings on the entity type and working from there.
This also makes it easier to map the configuration to a schema β†’ rather than dynamically setting them.

https://www.drupal.org/project/config_inspector β†’ may be used to inspect the configuration schema.

Proposed resolution

  • Add update hook deprecating gutenberg.settings, and moving active Gutenberg settings into the appropriate node type third party settings.
  • Introduce a new dedicated entity type settings page to configure Gutenberg.
  • Introduce a new Gutenberg setting which allows admins to specify the text field to use for Gutenberg rather than defaulting to the first text field.
  • Support YAML and JSON on the Field Mapping β†’ template definitions - since YAML is a superset of JSON, we can safely use Yaml::decode rather than json_decode, YAML is way more human friendly to use and fits well with the Drupal ecosystem.
  • Introduce some kind of API to specify which entity types should support Gutenberg (thoughts welcome on this).

Remaining tasks

Implement as part of the #3107797: Dynamic render blocks support (API rework using WordPress block parser rather than regex) β†’ work.

User interface changes

  • Move the Gutenberg settings into its own page/tab (Similar to Field Settings)
  • Support YAML for the Field Mapping template textarea

API changes

N/A

Data model changes

  • The gutenberg.settings configuration will be moved into the relevant node.type.$entity_type third_party_settings.
πŸ“Œ Task
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    RE: #39 the patch doesn't support blocks, but I think it would be fantastic if that could be added to the scope. Having Gutenberg in blocks is a powerful page building asset.

  • Status changed to Needs work 7 months ago
  • πŸ‡³πŸ‡΄Norway eiriksm Norway

    This MR needs to be rebased or merged up to date

  • Status changed to Closed: duplicate 20 days ago
  • πŸ‡³πŸ‡΄Norway thorandre

    This is a duplicate of #3445655 where we'll continue to work on this.

Production build 0.69.0 2024