I'm working on a project in craft cms and I want to make a gallery block that is added as an entry in craft. After doing some research I was trying to do it with dynamic mode of lightgallery plugin. The problem is that in dynamic mode, both sources and thumbnails for the gallery are defined in javascript, as an ex.
$(document).ready(function () {
$(".dynamic").on("click", function (e) {
$(document).lightGallery({
dynamic: true,
dynamicEl: [
{
src: "",
thumb: ""
},
{
src: "",
thumb: ""
}
]
Until now when I was doing galleries with this plugin I was using html structure and for loops in twig like this :
{% for image in entry.xxxx.all() %}
<a href="{{image.url}}">
<img src="{{image.url}}">
</a>
{% endfor %}
Link to codepen for you to get some image of the idea https://codepen.io/Snopek/pen/zYwNxgL
Any ideas how to fit these two together?
Thx for help