Inline image in structured text field?

Any ideas how to insert inline image from Assets into Structural text field?

1 Like

Hello @primoz.rome

The best way to do it is to create a block with a single asset or asset gallery field (An. “Image block”), and then allow for that block to be inserted into the structured text field

Hi @m.finamor yes I already have Image block… But I would like something like this:

PARAGRAH EXAMPLE:

Lorem Ipsum is simply dummy icon text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

If I am adding a paragraph in the Structured text field and then inserting a Block, the paragraph text is closed…

Oh, i see, so something that would result in a
<p> <img> </p>
Unfortunately that is not possible, as the image needs to be separate from the paragraph block in the structured text nodes, and they can’t be nested into each other.

So it is something that can’t be split into
<p></p><img><p></p>
You’ll need to do some local processing to change the query output locally to get the nested image

Yeah this is a big downside of structured text field. If this is something you could improve and added as editing feature to structure text field it would be really nice!

Actually on a second thought, another solution to go around this could be to create a block with a multi-line text field, with presentation set as HTML, and there you can easily add a paragraph with a nested image.
Then you can just allow that block to be included on the structured text :slight_smile:

Better solution for sure but still a bit hacky :slight_smile: … Is there some hard limit to have an option adding inline image within Structured text editor? I am sure I am not the only one who needs this.

Not that i’m aware of, i see you already created the feature request, so i’ll check it with the dev team to see how it goes

1 Like

Yes I did. If you find the solution, that would be awesome.

1 Like