Rich Text & labels

There is a bug concerning Rich Text & labels (css class)
https://user-guides.prismic.io/en/articles/383762-rich-text.

A label applied to an img is lost when an existing document is edited.

Steps to reproduce:
Add a label to an image in a Rich text field.
Save and publish the doc.
Edit the document again
The label applied to the image before is lost, so if you save and publish the doc you'll loose the information.

In the following thread,
Phil
states that it is not possible to add labels to images bot this it is not true.


Here is the model to achieve this:
"rich_description": {
"type": "StructuredText",
"config": {
"multi": "paragraph, strong, em, hyperlink, image, list-item, o-list-item",
"allowTargetBlank": true,
"label": "Rich description",
"labels": ["cms_text_align_left", "cms_text_align_center", "cms_text_align_right"],
"placeholder": "Rich description"
}
}

1 Like

Hello Juan, welcome to the Prismic forum!

Thank you very much for letting me know about this. I’ve submitted this ticket and the dev team will review it as soon as they take it from their queue.

Let me know if you can help you with anything else

Cheers!

Hey,

I confirm this is an issue !

Insert image and float her to the left of text (using a label) is so basic ! But impossible with Prismic. Really big issue ! Plz find a solution.

Hi Floran,

Welcome to the community!

As Paulina has said we’ve made the development team aware of this and they will respond here once they investigate this further.

In the meantime we have discussed how to achieve this behaviour using Slices here:

Thanks.

Create a slice ‘texte + img’ is a solution, of course. But it will be more convenient to fix labels on img :slight_smile:

2 Likes

Just wondering if there’s any update here?

It doesn’t appear so.
They’re pretty much ignoring us :pensive:.

Hi @rjessome & @juan.grau,

This was a failure on my part to communicate the discussion I had with the Product team, my apologies.

This is not something that will be re-implemented as it goes against the recommended workflow of using Slices described here.

What will happen is that is that we will properly deprecate it by removing labels from being selectable when an image is highlighted as this causes confusion and gives the impression that labels can be applied, though as you’ve seen they cannot.

Let me know if you have any further questions.

Thanks.

1 Like

Why can’t we have both? For some situations, I like the idea of having a simpler content editing process (one RichText content field, no slices).

Plus, I mean, it already works - we can apply labels to an image, and it saves, publishes and works fine. The problem is only that the label disappears if you re-publish. Is it such a huge development challenge to just not do that, and allow it to persist?

Not that creating slices and using them is difficult, but it seems like overkill when all we might want to do is float an image to the right.

:man_shrugging:

1 Like

I get your point, the problem is the RichText component is a complicated one to maintain, one we potentially plan to replace. So we are not investing a lot in it and by keeping this complex feature that we have at the moment in the Rich Text field, we spend time working on that instead of working on and improving our main feature Slices.

That’s why are pushing for better content modelling using Slices that will future-proof your project.

I get that deprecating feature is complex and a hard sell though, but it will make us move faster in the future. It will also remove frustration when we have bugs like this one that are not fixed.

This will be simpler and better for the future, but yes clearly the transition will be complicated

It’s alright, and I get it - it’s not a big deal - just seems odd, since it already mostly works.

This is being tracked as an open feature request here:

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.