Null alt attribute for images

From old feedback: Cwicly - Forum

An option to set null alt attribute for images inside Cwicly image block.

Maybe there could be a toggle to activate the input for the alt text. By doing that, the alt attribute would be empty/null unless you type something in. In case you don’t toggle it, the alt attribute won’t appear in the HTML.

Another suggestion:

Attached images

I would like this - makes sense to me.

I played around - it is implemented already, isn’t it? If I hit the blue point, no alt attribute appears in the source… ?

This is correct @Mario. Default is no alt attribute, I think (btw, is there a way to inherit the value from the media library?).
The point of this suggestion is, that it is currently not possible to set an empty alt attribute, like alt=""

It’s either no alt attribute or alt="your-img-desc".
Typing in "", will result in alt="""", same goes for custom attributes, so there isn’t a workaround either.

Perhaps it is still to hot for me :sweat_smile: guess, I got it now - it is not possible to set the attribute to alt="" That would be the recommendation from W3C instead of no alt attribute at all. My mistake, sorry.

I’d definitely like the ability to add null alt tags as well.

Every image should have an alt tag, but an empty alt tag is best for decorative images. This helps screen readers skip over the image: Decorative Images, Accessibility & ALT Text - Portent

1 Like

So, after investigating this topic again, here is my suggestion which makes the most sense for me.

There could be a toggle to enable/disable the alt tag.

When disabled (this could be the default one), the media library alt tag is used.
When enabling it, alt="" is used
When typing something in, alt="your-custom-alt-text" is used.

I am 100% for full control and probably be the 1st one who would complain, but let’s be honest.
What’s the usecase for using no alt tag at all? This is so rare, I probably didn’t use it myself ever.
So there is not actually a reason to consider a “no alt tag” option.

For me this comes also with a very easy understanding.
I think most people use the media library alt descriptions, this is currently missing (I think so?) at all and that’s why I would prefer it to be the default.
Thoughts?

1 Like

Hello everyone!

Thanks for jotting your ideas and feedback here, really appreciated.

Version 1.1.8.3 brings a beginning of implementation to this issue (static images). Make sure to regenerate your HTML.

An alt tag will be added and empty by default to every image block.
If the image has a media library alt tag and no alt tag is set in the image block itself, then the image alt tag will be used. The block alt tag takes priority over the media library one.

Unfortunately, Cwicly was adding the alt tag manually when a new image was applied, so we won’t be able to modify those blocks, so you’ll have to remove it manually if you want to use the media library alt tag. Apologies for this!

3 Likes