Welcome to the Liquify Community

Updated last month

Lightboxes

At a glance
Do the Lightboxes in Webflow work natively if the attributes are assigned in Webflow?
1
J
j
L
12 comments
Hey Levi, that should work as expected. But let me know if you come across problems :)
@Jan - I could use some help on this too. How should the attributes be assigned in webflow?
Hey, sure. What Lightboxes are you using? And can you give me the Webflow preview link? :)
So I'm using the webflow default lightbox. I have it primarily working, only webflow seems to want to control building the images list. I end up with an empty object in my lightbox 'items' array

{% for image in product.images %}
<div id="w-node-_6bbe0bdc-f74f-ec8e-a120-dc1b1b874b36-c6666a99" class="product-header2_modal-item">
<a href="#" class="product-header2_modal-lightbox-link w-inline-block w-lightbox">
<div class="product-header2_modal-image-wrapper-small">
<img
li-object:src="image.src | img_url: 'master'"
loading="lazy"
alt=""
src="{{ image.src | img_url: 'master' }}"
class="product-header2_modal-image-small"
>
</div>
<script type="application/json" class="w-json">
{
"items": [],
"group": "Product-Images"
}
</script>
</a>
</div>
{% endfor %}
Well, I found a workaround which is to replace the webflow lightbox link component entirely with a custom embed
We mostly use PhotoSwipe (https://photoswipe.com/) for image Lightboxes and F'insweet Modals (https://finsweet.com/attributes/modal) for other Lightbox Content, where you can use the forloop.index as the number.
This is awesome @jason and @Jan.
@jason did you add the attrtibute setting to the Lightbox element or the element within the lightbox? Just curious on the Webflow end.
I had to remove the webflow lightbox component and instead add my own code embed, like this:

<a
href="#"
class="product-header2_modal-lightbox-link w-inline-block w-lightbox"
>
<div class="product-header2_modal-main-image-wrapper">
<img
li-object:src="product.featured_image | img_url: 'master'"
loading="lazy"
alt=""
src="{{ product.featured_image | img_url: 'master' }}"
class="product-header2_modal-main-image"
>
</div>
<script type="application/json" class="w-json">
{
"items": [
{
"_id": "{{ product.featured_image.id }}",
"origFileName": "{{ product.featured_image.src }}",
"fileName": "{{ product.featured_image.src }}",
"height": "100%",
"url": "{{ product.featured_image.src | img_url: 'master' }}",
"type": "image"
}
],
"group": "Product-Images"
}
</script>
</a>
and an li-for:inside = image in product.images on the div that holds the images
Hi @Levi Benton and @jason, webflow lightbox is currently not available with liquify attributes. As jan has mentioned you can build your own.
Yep, basically what I did, but using my own code element, I was still able to use liquify attributes and make it work.
Add a reply
Sign up and join the conversation on Discord
{% endfor %}","dateCreated":"2024-12-07T19:52:17.109Z","dateModified":"2024-12-07T19:52:17.109Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/4ca74387-d665-48a2-b088-826c003d4a0d","name":"jason","identifier":"4ca74387-d665-48a2-b088-826c003d4a0d","image":"https://cdn.discordapp.com/embed/avatars/0.png"},"commentCount":0,"comment":[],"position":4,"upvoteCount":0},{"@type":"Comment","text":"Well, I found a workaround which is to replace the webflow lightbox link component entirely with a custom embed","dateCreated":"2024-12-07T20:49:52.980Z","dateModified":"2024-12-07T20:49:52.980Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/4ca74387-d665-48a2-b088-826c003d4a0d","name":"jason","identifier":"4ca74387-d665-48a2-b088-826c003d4a0d","image":"https://cdn.discordapp.com/embed/avatars/0.png"},"commentCount":0,"comment":[],"position":5,"upvoteCount":0},{"@type":"Comment","text":"We mostly use PhotoSwipe (https://photoswipe.com/) for image Lightboxes and F'insweet Modals (https://finsweet.com/attributes/modal) for other Lightbox Content, where you can use the forloop.index as the number.","dateCreated":"2024-12-08T10:56:08.121Z","dateModified":"2024-12-08T10:56:09.047Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/b4493d12-c7f6-4370-8c1b-bca956985c92","name":"Jan","identifier":"b4493d12-c7f6-4370-8c1b-bca956985c92","image":"https://cdn.discordapp.com/avatars/547767203345334283/0120b0d0a42e96a26c61006e1380bc03.webp?size=256"},"commentCount":0,"comment":[],"position":6,"upvoteCount":0},{"@type":"Comment","text":"This is awesome @jason and @Jan.","dateCreated":"2024-12-09T17:17:12.872Z","dateModified":"2024-12-09T17:17:12.872Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/c85f4566-dea4-453e-af3b-46ecb03cb8e1","name":"Levi Benton","identifier":"c85f4566-dea4-453e-af3b-46ecb03cb8e1","image":"https://cdn.discordapp.com/avatars/709470398999429252/b1484ddf10f7b0b54ce095fbb358f252.webp?size=256"},"commentCount":0,"comment":[],"position":7,"upvoteCount":0},{"@type":"Comment","text":"@jason did you add the attrtibute setting to the Lightbox element or the element within the lightbox? Just curious on the Webflow end.","dateCreated":"2024-12-09T17:17:43.565Z","dateModified":"2024-12-09T17:17:43.565Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/c85f4566-dea4-453e-af3b-46ecb03cb8e1","name":"Levi Benton","identifier":"c85f4566-dea4-453e-af3b-46ecb03cb8e1","image":"https://cdn.discordapp.com/avatars/709470398999429252/b1484ddf10f7b0b54ce095fbb358f252.webp?size=256"},"commentCount":0,"comment":[],"position":8,"upvoteCount":0},{"@type":"Comment","text":"I had to remove the webflow lightbox component and instead add my own code embed, like this:
\"\"
","dateCreated":"2024-12-09T17:48:30.713Z","dateModified":"2024-12-09T17:48:30.713Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/4ca74387-d665-48a2-b088-826c003d4a0d","name":"jason","identifier":"4ca74387-d665-48a2-b088-826c003d4a0d","image":"https://cdn.discordapp.com/embed/avatars/0.png"},"commentCount":0,"comment":[],"position":9,"upvoteCount":0},{"@type":"Comment","text":"and an li-for:inside = image in product.images on the div that holds the images","dateCreated":"2024-12-09T17:50:43.841Z","dateModified":"2024-12-09T17:50:43.841Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/4ca74387-d665-48a2-b088-826c003d4a0d","name":"jason","identifier":"4ca74387-d665-48a2-b088-826c003d4a0d","image":"https://cdn.discordapp.com/embed/avatars/0.png"},"commentCount":0,"comment":[],"position":10,"upvoteCount":0},{"@type":"Comment","text":"Hi @Levi Benton and @jason, webflow lightbox is currently not available with liquify attributes. As jan has mentioned you can build your own.","dateCreated":"2024-12-09T20:04:34.400Z","dateModified":"2024-12-09T20:04:34.400Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/9198b265-c813-4ed7-89ba-4025d177dc62","name":"jonas.halbstark","identifier":"9198b265-c813-4ed7-89ba-4025d177dc62","image":"https://cdn.discordapp.com/avatars/947621552478904320/9741d807d28f33e26a3a3b01c121c60f.webp?size=256"},"commentCount":0,"comment":[],"position":11,"upvoteCount":0},{"@type":"Comment","text":"Yep, basically what I did, but using my own code element, I was still able to use liquify attributes and make it work.","dateCreated":"2024-12-09T20:23:59.420Z","dateModified":"2024-12-09T20:23:59.420Z","author":{"@type":"Person","url":"https://liquify.hall.community/members/4ca74387-d665-48a2-b088-826c003d4a0d","name":"jason","identifier":"4ca74387-d665-48a2-b088-826c003d4a0d","image":"https://cdn.discordapp.com/embed/avatars/0.png"},"commentCount":0,"comment":[],"position":12,"upvoteCount":0}],"author":{"@type":"Person","url":"https://liquify.hall.community/members/c85f4566-dea4-453e-af3b-46ecb03cb8e1","name":"Levi Benton","identifier":"c85f4566-dea4-453e-af3b-46ecb03cb8e1","image":"https://cdn.discordapp.com/avatars/709470398999429252/b1484ddf10f7b0b54ce095fbb358f252.webp?size=256"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0}}]