Hi guys,
Just wondering if it is possible to have a form where people enter their info and upload a photo, then this will automatically add the photo to a gallery. Once you click on the photo, a lightbox will open with their info they entered?
I know how to create a form and upload button, just wondering with the dynamic pages etc if it can automatically add. TIA!
Thank you Ido Inbar!
Hi Leana,
We located a bug with the Pro Gallery and working on a fix.
I will update this thread once we have any feedback.
Hi Yoav!
The code is working to open a lightbox when an item is selected from a "Grid Gallery" but not from "Wix Pro Gallery". Is there a way to make it work on "Wix Pro Gallery"?
So it looks like we need to create two dynamic pages to get this to work. Can someone look at my page to see if this is possible as it is?
Thankyou! And the next and previous buttons?
To open a lightbox instead of navigating to a dynamic page, you will have to code a little. You cannot make a lightbox dynamic in the sense that it has it's own url, but you can make a lightbox show dynamic content regardless of the url (note - if it does not have a unique url per item, social networks and search engines cannot see this content).
You start by registering a gallery onItemClicked event, which gets the clicked gallery item and index. We move the dataset to select the same element and then open the lightbox with the current item. It will appear like
import wixWindow from 'wix-window'; export function gallery_onItemClicked(event) { $w('#dataset1').setCurrentItemIndex(event.itemIndex) .then(() => { wixWindow.openLightbox('lightbox name', $w('#dataset1').getCurrentItem()); }); }
In the lightbox page code, in the on ready event, read the item and show it on the page
import {lightbox} from 'wix-window'; $w.onReady(() => { let item = lightbox.getContext() // use $w to set the item data on elements of the page });
Using this pattern you cannot use a dataset on the lightbox, rather the $w API.
What was the problem? Maybe you can post how you fixed it. It might help people who encounter a similar problem in the future.
And can you help with my next and previous buttons with the dataset as they don't work and appear disabled? Thankyou https://tailoredwebdesign.wixsite.com/universesports-1/Hall-of-Fame/Kane
OK thank you I see what I did wrong. Cheers. Can u do with lightbox instead of a page though? ie dynamic lightbox?
yes I have but it is not working? It is the universe sports1 site on the hall of fame page if you can have a look?
Hi,
If I understand what you're trying to do correctly, this shouldn't be a problem. Have you tried connecting the gallery to your collections using a dataset? And then set the Links connect to section to connect to the user's dynamic page?
Ok I have nearly got this going, but not with lightboxes but this is ok. However, when I click the image in the gallery to go to that users entry, it won't work? Can this not work with galleries?