Pro bug / issue: Image alt tag not brought through by parameter usage

When an image src is populated by a parameter, it doesn’t automatically populate the Alt Text based on the media item’s alt text.

To demonstrate:
An image element with the Source set directly has its alt text show up like this in the inspector:


And has the correct alt tag in the html:

However when it is pulling in a parameter, it shows like this in the inspector:


And has the default alt="Image" tag in the html:
image

Although is some instances having the Alt Text as a separate parameter is feasible, the benefits of being able to set the image alt text in the media library and have it pull through automatically are really great.

Would there be a way to have this pull through automatically, if the Alt Text is left blank, or else to access the Alt Text of an image parameter via an argument, e.g. {{dc:p:image return="alt-text"}} or something akin to that?

Cheers!

4 Likes

@charlie have you had a chance to look in at this bug?

I have now. We’ll release a fix to have it check if the URL is an attachment URL, and then output the alt text if the alt text is empty in your controls. The alt-text is nice idea I’m not sure I’ll get to that quickly though. Thanks for the notes, have a great day.

Great!

This issue seems to be connected to the other issues I found with the width and height attributes not being set if the image source is pulled in from parameter data. Will this fix sort that out too? If anything, that is the larger issue, as updating older sites without it will cause significant layout shifts and potentially breaking changes to image sizes across the board.

They are both connected and will be sorted soon in the next release. It doesn’t have context of the attachment id in this release, when it does the issues go away. Have a great weekend.

1 Like