Currently, when you create a new Custom Block, you first get a form to create the custom block, and then you go to a 2nd form to place the block. This is confusing, because some of the display information about that block isn't available in the first form (like "Title"), and you just need to know that that is coming on the 2nd form.
Then when in "Edit" mode, there are two buttons (a gear and a pencil) which represent placement and edit form respectively, but it's hard for users (who don't care about this distinction at all) to keep straight which is which.
This experience is different than adding other Blocks, where there is only one form. It's also confusing when adding a custom block that was previously created, because the user is only shown the 2nd form, rather than going through both again. So, this is a world of inconsistency from the perspective of the user (even if it makes perfect sense from how Custom Blocks are implemented).
Here's my proposal:
- Combine the Custom Block creation form with the placement form
- Eliminate the special pencil icon for Custom Blocks, and have the gear just go to the combined form
In Drupal 7, FPPs could be created and placed in a single form, and the IPE gave only a single gear icon for editing any kind of pane regardless of type, and allowed editing everything with that single dialog (even if it was a multi-step form, you got all steps every time). This is an attempt to get back to that UX!
| Comment | File | Size | Author |
|---|---|---|---|
| Selection_075.png | 33.31 KB | dsnopek | |
| Selection_074.png | 24.2 KB | dsnopek |


Comments
Comment #2
dsnopekI've been digging through the code for this and trying to come up with a way to do it, and there's a dumb chicken-and-egg problem here: we can't render the 2nd form, because it's created by the block plugin instance, but the plugin id is a derivative based on the uuid of the content block entity. So: the 2nd form can't be created through the normal API without the entity being saved first.
Of course, we could cheat and generate a form just like we know
\Drupal\block_content\Plugin\Block\BlockContentBlock::blockForm()is going to generate, but what happens when core changes that (as core is prone to do these days)? Or, what if someone swaps out that whole class? Or a contrib module alters the form?The only clean solution I can think of, would be to abandon
BlockContentBlockand it's derivatives for placing content blocks in Panels, and instead use a new block plugin that doesn't use derivatives but instead keeps everything in block configuration. We'd just hide all those derivatives from the UI, and show our block plugin instead. And our block plugin would store the actual entity data or reference to an existing entity in its configuration. This would also solve the problem that right now all block content entities are reusable, ie #2626942: Creating Custom Blocks that are not re-usableThen I realized this is exactly the same as #2844054: Inline Revisionable Content Blocks & #2883154: Support inline blocks in Panels display variants :-)
So, I think we need to implement those first, and then this one becomes easy!