I’ve added alt text into my image type. Following the WCAG and ARIA guidelines, alt text on an image should be appropriate for the goal and content surrounding the image. If a user wants to reuse an image on multiple pages, but with different contexts (and thus different alt text), should they upload a second digital asset (with it’s own alt text)?
Should they create another content type as a wrapper so they can reference the same digital asset, with different alt text? This seems like it’d become a burden to use and contribute images.
Is there another solution that hasn’t been considered?
I strongly prefer to use binary images that are on the content structure rather than ‘assets’ - there’s just so much better utility this way. The image lives on the content and goes away if and only if the content is gone. You never have to go find said asset. The only thing I use an ‘image type’ for is header/footer bits. Even in my ‘text’ contentlets, I have binary image, an image class field and a radio for things like float/center/etc - these also auto size using the binary image manipulation field. I never want anyone using my backend to deal with a separate file or embed an img src into something via html. Who knows how big or how small it is? How can you tell when it is deleted?
Anyway, done in this manner, the solution is obvious. You can have a text field for the alt tag, or you can build the alt tag like ‘Banner Image of $con.title’.
I can give example code if this isn’t obvious.
Thanks so much for the question Travis, and the insights Mark! I checked in with Melissa on our ProServ team as well and her thoughts were that if you were using the image content type and included an alt-txt field, you should make that as generic a description as possible to be able to use in most cases across the site. Then, if you are pulling the image into a widget or placing in a piece of content, you can include a field that can ‘override’ the default alt-text associated with the image.
Hope that makes sense! Thanks Travis!