Open hubionmac opened 6 years ago
I agree it's better to use Grav's media html function (I think this plugin predates some of these features to be fair!). But simply populating the title
and alt
attributes with image.basename
provides no usability or accessibility benefits for users.
Also this will only work in image mode because text mode uses the image as a CSS background.
I'm working on a new mode which would allow setting these properties in a way that could be used (dynamically) like your example. Unfortunately I don't know enough layout/CSS to move away from the background rendering approach. If we can overlay text on an img
tag safely, I'll do that.
Great suggestion to think about, though.
Instead of hard-coding the html in
lightslider.html.twig
it would be better to insert something like{{image.html(image.basename,image.basename)}}
more flexible and the slider's img-tag gets a title-value and alt-value ontop ;-)