Code to Apply alt Tag to Classic Image element?

Hi guys,

When I built my website years ago, I used Cornerstone and we used Classic Image elements for most things. I think we thought that it would automatically apply alt tags from the value in the media library, but obviously it does not. The alt tag needs to be added directly in the element.

I’m just wondering if, at any point, you guys came up with code to automatically apply the alt tag.

So, ideally, it would work like this:

  1. Filter the code for displaying classic image elements
  2. Check if the alt tag is defined directly in the element
  3. If it is, do nothing
  4. If it’s not, get the alt tag value from the media library and print it

I guess a script that would just auto-populate that value within Cornerstone would also work.

Does anything like this already exist?

I believe I have hundreds of images like this, and if there’s a way for me to fix it all in one go, it would save me a ton of time. Otherwise I’m going to have to go through and manually update them all.

Let me know, thank you!

Hi @brianjohnsondesign,

Regretfully, there is no such option available for that.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.