Motivation

It would be great if Gutenberg could support SDC components.

Proposed resolution

The implementation would be similar to Drupal blocks / content blocks integration.

Issue fork gutenberg-3575819

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

marcofernandes created an issue. See original summary.

marcofernandes’s picture

Status: Active » Needs review
vegardjo’s picture

Great work! This is quite huge I'd say, both bridging the gap between Canvas and Gutenberg, and also removing the need to make custom blocks just to wrap inner blocks in something.

I've done a little testing from the editor / site builder perspective only, making my own SDC and also trying it on various content types with Gutenberg enabled. I have not found much to pick on, but some comments:

For the slots we're adding templateLock and template, which is very tied to Gutenberg behaviour, but also have very generic names. I'm not sure if there are any rules or practices around this, but having this "namespaced" in a way seems better, for instance like gutenberg_templateLock and gutenberg_template

slots:
  quote:
    title: Quote
    description: The actual quote
    templateLock: all
    template:
      - ['core/paragraph', {placeholder: 'dolij'}]
      - ['core/heading', {placeholder: 'pandadn'} ]

Another thing I saw is that if you on one content type only select the top "All" option under "Allowed SDC component blocks", this is not saved, so it will not be ticked off the next time you go to edit it, and thus does not work. No SDCs are actually available when you tick it. If you tick individual ones, it works as expected.

(As a side note this "All" option might be a bit too magical? Would it be preferable if ticking it would just tick / untick all checkboxes below, instead of having to handle it specifically in code? But that is a different issue I guess)