Problem/Motivation
Right now if you use the "Content Blocks" there's no preview -- just "No Preview Available" text on a grey background. It makes sense because you can't render a block that doesn't exist yet. Is there any way to get a more accurate preview "image"?

Steps to reproduce
1. Allow a "Content Block" like the "Text" block to be allowed on your node.
2. On the node edit page, use the "Block inserter" library to add the "Text" block. Hover over the block in the "Content Blocks" section and see no preview image, just "No Preview Available".
Proposed resolution
I imagine the ideal solution would be to render these blocks dynamically with some kind of default values, and then use a screenshot of that. Or possibly grab an existing block of the same type and render that?
An alternate, easier approach (explored initially here) is to allow editors to provide an image they load up somewhere to be the preview image.
Remaining tasks
- Submit preview image option patch
- Decide if that's a good approach or if we should go down the rendering path.
- If we do, add documentation about this feature somewhere... where does that go?
User interface changes
None
API changes
Adds a section to the gutenberg.yml file content-block-preview-image: where you can set a preview image per content-block bundle, like this: content-block/simple-hero: images/simple-hero.jpg
Data model changes
None
| Comment | File | Size | Author |
|---|
Issue fork gutenberg-3617959
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
Comment #3
mariacha1 commented