getgrav / grav-plugin-lightslider

Grav LightSlider Plugin
https://getgrav.org
MIT License
14 stars 15 forks source link

Use grav Image.html() function to create slideshow-image #31

Open hubionmac opened 6 years ago

hubionmac commented 6 years ago

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 ;-)

hughbris commented 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.