Is it possible to have dynamic lightboxes like dynamic pages that integrate the data in the same way?
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:
- 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
- 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:
good luck!
Thanks for your detailed response!
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!
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
Br,
Jakub
So I need to do exactly this!!! But need help!!!