How to handle image layout and metadata

Hi,

What is the recommended way to handle image attributes like width/height and how they overflow when added inside of a multi-paragraph field?

For example, when using a markdown multi-paragraph field, we can insert multiple images (as long as they’re uploaded already using the Media tab) but I didn’t see a way to specify extra metadata.

A few options come to mind:
1- Switch to using the HTML editor and type the image attributes + CSS styles by hand (pretty hacky and I can’t see a non-technical person doing this).
2- Add an Image model which contains the height / width and any other needed attributes and use it in a modular block and let the frontend use these custom fields.

1 Like

hello @zaid thank you for your question :slight_smile:

Currently you are right about the two options. Just a slight remark is that you can write HTML in the Markdown editor, so you can leave MD for most of the content and just add HTML tags for images, but yes, it’s hacky!

We have a planned feature for that:

Which is going to be developed in the coming weeks. More details on the roadmap here: https://www.datocms.com/blog/what-happened-in-last-three-months

Otherwise yes, your option 2 of using a modular content is the more structured way which allows more control from the frontend code and leaves less control to the editor.

If you want to subscribe to the issue you’ll be notified as soon as it gets published :slight_smile:

2 Likes

Hi Mat,

So is there a feature request active to improve this experience for not technical uses in the HTML editor?

Aside from adding image alignment, width etc there seems to be no easy way to add an alt tag either

Thanks

Shannon

yes @powerboard i think this feature request is good for what you are saying! Make sure to upvote!

Any news on this. Whilst i appreciate fancy things like focal points on image, this is just 101 basic stuff that should be included in a html editor. Are you using a library for the html editor? Can you just add it on as an option.

What am i meant to tell a content editor with no html experience?

I’m sorry @powerboard but this feature request has only 3 votes while the focal points had 30 :frowning:

We need to give priority to what is most requested and feasible in the time we have. We’ll comment on every feature request that we decide to pick up and eventually deploy.

Sorry if I cannot give you more info here.

I would add that there are several feature requests that are very similar, but they have votes distributed between them. So adding them all together would give a better picture of this request.

For us too it is important that our non-technical editors be able to set alt text on images they insert into rich text fields.