timmyomahony / craft-matrix-field-preview

Configure a screenshot preview for all your matrix field blocks, giving your clients a better publishing experience.
https://plugins.craftcms.com/matrix-field-preview
Other
16 stars 4 forks source link

FR: Configure preview display for Neo child blocks #111

Closed turnstylerj closed 1 year ago

turnstylerj commented 1 year ago

Description

When using Neo fields for a content builder, it's common to use child blocks for repeatable sections of content (i.e. rows inside an accordion), but the preview modal adds extra friction/clicks when there's only one type of child block that allows the author to add a new set of repeatable fields inside the block.

In these situations, it'd be nice to have the ability to disable Matrix Field Preview for child blocks of a Neo block within that block's preview settings.

Example

2023-09-21 at 14 18 13

timmyomahony commented 1 year ago

Interesting, I understand what you mean.

timmyomahony commented 1 year ago

Do you think there times when you would want to see previews when there is only 1 child block? I'm thinking that the plugin could potentially skip previews altogether when there's only 1 child block (instead of it being configurable). But it might be the case that there are times when you still want to show the user the overlay even if there's only 1 child.

turnstylerj commented 1 year ago

Personally, no I don't think I'd ever show the preview with only one child block. But I could potentially see other use cases where someone might want to for consistency, and there are times when a Neo block will have a few different child blocks (but I only really need the visual preview on the parent), so I think having it configurable on the parent block for its children would allow for the most flexibility.

timmyomahony commented 1 year ago

I've added an approach to handling this in the latest release 4.1.0.

I've simplified things a little bit though. There's now an additional setting for neo fields that lets you disable the plugin when there's only 1 child block available for a neo field:

CleanShot 2023-10-04 at 15 35 03@2x

Check out the latest release and let me know if it works OK for you.

turnstylerj commented 1 year ago

Thanks for the quick turnaround! I think the level of Neo support is solid enough now to give this plugin a spin on a full site, so I'm looking forward to working with it and will definitely provide some feedback!