Feature request: alt tag field for assets by default #10302
-
DescriptionAt the moment assets have Adding an |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
|
I was about to request this. I feel it's a wonderful enhancement which I would love to see. |
Beta Was this translation helpful? Give feedback.
-
|
I add an Alt Text field to Asset field layouts intended for images—which is most of them—but there are cases like PDFs and .zip archives where it's not relevant. I think this would be a healthy default as long as it could be turned off/removed for special cases. |
Beta Was this translation helpful? Give feedback.
-
Hi @mattstein, came to log this ticket again and I was correct in remembering I already logged it some time ago 😂. I usually add an 'alt text' field to my assets, but it would be great if it was added by default in the image config: Hoping this eventually makes it's way into Craft 4 or even a version of 3.5! |
Beta Was this translation helpful? Give feedback.
-
|
I think it’s a great idea to promote accessibility considerations for content editors @JayBox325, I was just arguing for cases where it wouldn’t make sense to expose an Alt Text field by default since Craft purposefully doesn’t make assumptions about the front end. Ultimately I don’t know whether it’d be best handled by Craft core or an opinionated plugin focused on accessibility tools—but luckily for both of us it’s not up to me! :) |
Beta Was this translation helpful? Give feedback.
-
|
I would say that alt text is part of the content of the image, not really file metadata, so it makes the most sense as a custom field that lives alongside other content. And we can’t add custom fields to assets by default in an installation because they are added via the volume’s field layout, and there aren’t any volumes in a default Craft install. |
Beta Was this translation helpful? Give feedback.
-
|
Went ahead and added this for Craft 4, since it gives Craft a way to add alt text to asset thumbnails and I also added a “Has alternative text” condition rule for assets, which could be used to find assets that do/don’t have alt text added yet. PR: #10304 |
Beta Was this translation helpful? Give feedback.

Went ahead and added this for Craft 4, since it gives Craft a way to add alt text to asset thumbnails and
<img>tags returned bycraft\elements\Asset::getImg(). Also helps with WCAG compliance.I also added a “Has alternative text” condition rule for assets, which could be used to find assets that do/don’t have alt text added yet.
PR: #10304