Especially for custom blocks, but even for programmatic, module-derived blocks, it'd be really neat to be able to hit a "preview" button and know instantaneously what the block's content going to look like before it's live on the site.
Currently, the process for adding a custom block to the site goes like:
- Go to admin/build/block/add.
- Enter the block body. Also enter in some wacky visibility stuff so your inevitable mistakes aren't visible to your larger website audience.
- Save the block page.
- Move the block to one of your regions so it's visible.
- Gasp in horror at your awful missing </ul> or whatever horrible thing you messed up that completely breaks your site's layout.
- click "configure" on the block.
- Edit the body, trying to get it right this time.
- Save the block page again.
- Repeat steps 5-8 until horror gasping subsides.
- click "configure" on the block one last time.
- Set the visibility on the block how you actually want it.
- Save the block page one last time.
That's an awful lot of steps.
How about this?
- Go to admin/build/block/add.
- Enter some body text. Be bold. Leave off as many tags as you want.
- Click "Preview"
- Fix as necessary.
- Set the visibility how you want it.
- Save the form.
- Move the block to proper the region.
- Go treat yourself to a nice tea, since you just got 5-10 minutes of your life back.
This would work basically like node previews, where on the customize form there's a preview button that, when clicked, would display the block content in the content area, so that you could see what it looked like iteratively before actually saving it to the database.
Maybe it also makes sense to have a preview icon on the main admin/build/block page to save you a click if you want to know what the "OG Details" block will do when enabled. Not sure.
Comments
Comment #1
michelleAwesome idea. I usually go make a story node to test out blocks. This is much better.
Michelle
Comment #2
scoutbaker commented+1 This would be a terrific enhancement.
Comment #3
catchGreat idea. Like Michelle, I made a node with a path called block_test once just for setting visibility to, then promptly forgot about it until six months later. It's no fun.
Preview icon on admin/build/block - this'd make lots and lots of sense with drag and drop. I imagine it'd not be a trivial thing to do though. There's also the chance you enable a nasty broken php input format block and WSOD yourself (until refresh I guess, but still).
Comment #4
Anonymous (not verified) commentedThis is definitely a much needed feature. The blocks feature in drupal is excellent but creating and editing multiple blocks consumes more time than necessary because I need to save, activate the block, check the block (usually in another browser tab), then repeat if changes are necessary.
Comment #5
catchSince this came up in testing I'm retitling this.
Comment #6
floretan commentedAnother improvement that I would add to this is the ability to assign a new block to a region directly on admin/build/block/add (similarly to how one can assign a new CCK field to a fieldgroup on the field creation page).
The current workflow is:
Suggested:
This really only makes sense in combination with the suggested preview functionality.
Comment #7
sutharsan commentedMoving all usability issues to Drupal - component usability.
Comment #8
gaele commentedWe're currently working on this at the Drupal UX Sprint.
Made a new issue for #6: #503908: Assign a new block to a region on add block page
Comment #9
traviscarden commented+1 - I've wanted this for a long time. Keep up the good work!
Comment #10
Bojhan commentedSomewhat sadden that we could not get this fixed, but I hope we can put more attention to blocks in Drupal 8. Moving it to a more fitting part of the cycle, and hope we can also make it more generic to preview more then just static text
Comment #11
druvision commentedIt would be really great if the block preview would be accessible directly from the list on block on http://example.com/admin/build/block, when I mouseover the block name.
Comment #12
chien_fu commented+1 Yes! This would be great! So many blocks and I keep forgetting what they are!
A preview on the blocks list would be superb.
Comment #13
yoroy commentedBump! :-)
Comment #14
traviscarden commentedRe-tagging.
Comment #15
yoroy commentedComment #27
capysara commentedThere's no stable release of this module, but it looks like it might address the issue, or at least be a starting point: https://www.drupal.org/project/entity_preview