Closed 01Kuzma closed 1 year ago
I believe you could easily extend main plugin template by copying it to /user/themes/[YOUR_THEME]/templates/photoswipe.html.twig
(you'd need some custom theme) and change src
on line 13
. This should work
Most likely I will not implement this feature in the plugin itself, because it would add one more dependency and not many need this I assume 🤔
Thank you!
I will try this!
P.S. I presume it should be something like this: <img src="{{ item.cropResize(500, 250).url|e|webp }}" alt=""/>
Probably yes. Would need to test with Webp plugin installed. Or maybe |e
is not needed at all in such case
Just one question: are you sure that overridden template file should be placed here: /user/themes/[YOUR_THEME]/templates/photoswipe.html.twig
not in a deeper folder? As an example /user/themes/[YOUR_THEME]/templates/plugins/photoswipe/templates
or other folder ?
Now I'm experimenting with it and overridden twig template doesn't make any difference... ALready placed in different folders...
Seems to be working fine for me 😕
Try clearing caches
Understood! Thanks for tip ;)
Did you manage to make it work? Just curious 🙂
Unfortunately no, I tried yesterday, but webp
was not loaded...
I will try further to investigate it. The problem is that webp plugin doesn't work on my localhost, so it's harder to debug the problem
Hello! Did you try to integrate the
webp
support with the gallery? At this moment this grav webp plugin supports image conversion intowebp
file format.img
tags should be appended with these filters:It it possible to override the template to make such support? Or everything is done in
js
?P.S. it seems that the
photoswipe
library supportwebp
file format natively (but probably partially?)Thank you!