# Dynamic lightboxes

**URL:** <https://forum.wixstudio.com/t/dynamic-lightboxes/34375>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [August 13, 2017, 9:53am UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375 "2017-08-13T09:53:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jds404](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jds404/32/746_2.png) [@jds404](https://forum.wixstudio.com/u/jds404)\
**Post date:** [August 13, 2017, 9:53am UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375/1 "2017-08-13T09:53:26Z")

</div>

Is it possible to have dynamic lightboxes like dynamic pages that integrate the data in the same way?

---

<div class="post-metadata">

**Author:** ![ziv-shalev](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ziv-shalev/32/669_2.png) [@ziv-shalev](https://forum.wixstudio.com/u/ziv-shalev)\
**Post date:** [August 13, 2017, 7:33pm UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375/2 "2017-08-13T19:33:03Z")

</div>

It’s possible.  
but let me first explain a bit about the differences.

dynamic pages are used when you want to reuse the same page template for displaying different content items that you have in a collection.  
the key to dynamic pages is that each will have a distinct URL and it is that URL that drives the page content.

on the other hand, lightboxes do not have (or need) a URL. you just want them to load from a given page.

so in your case, I would:

1. in the editor:

- add a lightbox to the item’s dynamic page,
- add a dataset to the lightbox, connected to the collection where you have the data you need to render the lightbox
- bind the lightbox elements to the dataset

1. at runtime

- use the lightbox APIs to open the box with the current item’s ID as initial context for the lighbox
- in the lightbox code, use that ID to set a filter to the dataset you’ve added so the dataset will fetch the item you need
- let the databinding magic happen 😉

you can read about lightbox APIs here:

> **[wix-window-frontend - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-window-frontend)**
>
> The wix-window-frontend module contains functionality that pertains to the current browser window.

> **[Lightbox - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-window-frontend/lightbox)**
>
> A lightbox pops up on your site to grab your visitor's attention.

good luck!

---

<div class="post-metadata">

**Author:** ![jds404](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jds404/32/746_2.png) [@jds404](https://forum.wixstudio.com/u/jds404)\
**Post date:** [August 13, 2017, 7:48pm UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375/3 "2017-08-13T19:48:38Z")

</div>

Thanks for your detailed response!

---

<div class="post-metadata">

**Author:** ![david-seroy](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/david-seroy/32/868_2.png) [@david-seroy](https://forum.wixstudio.com/u/david-seroy)\
**Post date:** [September 21, 2017, 3:14pm UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375/4 "2017-09-21T15:14:27Z")

</div>

Rummaging through old posts. This is exactly what I am hoping to do! However, with no coding experience, it is still beyond my skillset. Is the actual code available for this that I can paste in and set to my specific datasets?

While we’re on the topic, I cannot bind Google Maps to a dataset. So, what would the code be to also do something like that, if possible?

Thanks!

---

<div class="post-metadata">

**Author:** ![jakub](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jakub/32/1674_2.png) [@jakub](https://forum.wixstudio.com/u/jakub)\
**Post date:** [November 8, 2019, 7:31pm UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375/5 "2019-11-08T19:31:06Z")

</div>

Hi David,

If still needed, I solved my issue with code here:  
[https://www.wix.com/corvid/forum/community-discussion/data-from-the-dynamic-page-in-the-lightbox](https://www.wix.com/corvid/forum/community-discussion/data-from-the-dynamic-page-in-the-lightbox)

Br,  
Jakub

---

<div class="post-metadata">

**Author:** ![mann-woods](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mann-woods](https://forum.wixstudio.com/u/mann-woods)\
**Post date:** [September 5, 2021, 6:45pm UTC](https://forum.wixstudio.com/t/dynamic-lightboxes/34375/6 "2021-09-05T18:45:14Z")

</div>

So I need to do exactly this!!! But need help!!!
