i created a gallery with collection list and custom code: The endresult is that i can click on one image and only images of this group will appear and the group name is set by the list name.
So as you can see in the video below there are projects from an architect and each project has a different lightbox group.
Video:
THE PROBLEM:
I had to use several image collection fields for each image. I couldnt set it up with multi-image field.
The Lightbox want to display image fields where isnt an image set. So thats why in the video appeared an infinite loading icon and also at the bottom overview in the lightbox you can see the black box.
For the custom code i had to use the following code/picture:
So how can i get this fixed, that the lightbox dont show the image fields that arent set with an image ?
Maybe someone know a custom code that i can use for it. Something like that check if the image is set. If not then dont allow to display it in the gallery. I dont know im not a programmer. But i really really hope that someone can help me here. Its very important for me!
i put it first of all in the before body close tag and it didnt work. i also posted it in head tag for testing, but it dont work either. The black boxes are still there and the lightbox are still trying to load the images that doesnt exist.
Here is a codepen pen that shows the script working on HTML from your site that I used that to base the script against. You can see the HTML in the pen.
It was very specific to a certain structure and class names. I notice you have different structures on that page now. So either you adjust the script or the source. No moving targets please. I did not bother to look at every one of your implementations. If you need me to, contact me for freelance work.
Personally I don’t use the Webflow lightbox as a photographer or for client galleries outside of page templates (lack of control), and leverage alternatives instead.
@Pixelgiant -
The problem with the script is that the elements don’t exist on the page until the lightbox is displayed, since they are dynamically created from the JSON embedded in the page.
I don’t have a workaround for that at this time and not sure it is worth the effort, since this is not really a supportable approach anyway.
Things to consider. The ability to use multi-image fields from a normal collection list (not on a template page) is a planned feature coming. This is a reason I have never bothered with this and use other approaches.
I did test loading a galley from the corresponding template via Ajax. I got that to work but need some time to work around some issues with that approach. Not sure if it is even worth the effort. You are trying to save one click instead of two (link of image goes to project page, and then next click loads the lightbox).
This is a big issue for many people right now. As I said I use a completely different approach ( Images are on CDN, a JSON file is there too, referenced in the collection item. I just pull the images URI’s in via a script and display them using Fancybox. Wish I could be more helpful.
Okay, thank you very much for your help! ive got few questions:
With the multi image field, i also wasnt able to create groups out of a collection list like “get group name from…”
i would like to have for each project one lightbox group. So when i click on one project, only pictures from this project are in the lightbox. And when the client add an project it should automatically added to the gallery with a lightbox group.
I mean if its possible to archive what i want with multi image field, then i dont need this custom code. Maybe i did something wrong, i dont know. But as i saw and tested, i also cant archive it on a template page right ?
If it isnt possible with a template page, what are my options to archive it? The client want to have it like that, so i have to find a way to get it done