Preview in collapsed block

Text-previews have disappeared from collapsed ‘Text, Single Column’ blocks – Most (if not all) other blocks have some sort of preview when they are collapsed. Without this feature, it can be difficult to efficiently edit some pages, especially those that are more complex.

When we first switched over to DATO in March, this feature was available, but at some point in June or July, this changed.

Thanks for reading,

Hey @mphofer! Happy new year :slight_smile:

Is the “class” single-line text field in that block new?

It seems like where a block contains both a multi-paragraph text field and a single-line string, we’ll get the preview from the single-line string instead, with no option to override it :frowning:

This – the ability to choose which specific field gets used for a block preview – might be a nice feature request? ✋ Feature requests - DatoCMS community ?

Otherwise, there is also a workaround you can do:

If you convert the “class” field to a multi-paragraph text field instead, then it won’t have priority anymore, and the block preview should go back to the text field instead. There shouldn’t be any data loss when you do that, and the API response for the developers should still be the same.

(You can test this on a forked sandbox environment first if you’d like!)

Does that help?

Hope you all are doing well there :slight_smile:

All I know is that the preview text used to appear without having to do anything extra. The “class” may have popped up when something else was fixed/changed. I don’t really work in that part of the site too much. This comes up when I edit more complicated pages, as it’s easier to see a bit of the text than to have to keep opening & closing the blocks.
I will run this by Kate & Pete, as they’re more familiar with this. :confused:

It’s possible that field was added by somebody, and this was an unintended consequence (on our part) :frowning: Sorry about that!

It should work, but feel free to have them get in touch with me too if that’s easier! Sorry for the hassle :slight_smile:


@kwebbink: Hi! Good to hear from you both :slight_smile:

PS in devspeak, the Preview algorithm will prefer single-line text strings over multi-line fields. If you make the class field a multi-line one, that shouldn’t change the API output, but should allow the other field (text) to be used in the Preview again. Sorry for the hassle.

Good to hear from you, too, @roger !

Thanks for suggestions – we’re checking into it.
& had a related feature request here: Ability to choose multi- or single-line text field for Block preview


Awesome, thanks! I’d vote for that too if I could :slight_smile: Not doing dev yet here so not something I can implement myself, but hopefully in the future…

1 Like