Lighbox caption attribute for CMS images: multiple groups w conditional visibility - error

I thoroughly enjoy your solutions, and was happy to see the CMS Lighbox caption solution. I do see a problem when you have more than one lightbox groups with conditional visibility settings on (do not show if image field is empty).

This is my example:

I have a dynamic page with two lightbox groups (clinical and histology) each pulling images and captions from the same CMS collection list (Group 1 Clinical images 1-5 Group 2 Histology images 1-14). Some of the collection lists has less than 5 clinical images, the empty fields are turned off by conditional visibility.

If I have 5 clinical images (no need for conditional visibility to turn off empty elements), both lighbox groups (clinical and histology) show captions.

If I have less than 5 clinical images in the collection, the captions don’t show up in the second lightbox group. Does conditional visibility breaks the attribute downstream? Could you recommend a solution?

The example I have below now combined the two groups into one, as I thought that was the problem. But the same issue happens. If I don’t have 5 clinical images, the the second set of images will show but without legends.

With 5 clinical images captions work on all images:

With 3 clinical images:

I would greatly appreciate your help. Thanks. Andras

Hi Andras, interesting problem, I’ll take a look when I can.
I have a lot of client work to attend to now that I’m back from vacation.

I suspect that SA5 Lightbox Groups doesn’t differentiate between conditionally-hidden items and visible ones and is getting out of sync between the visible items and the underlying JSON data that Webflow stores the captions in.

I’ll check it out hopefully this week and see if there’s an easy way to maintain that sync.

Hi memetican, thank you for looking into this. Much appreciated, please keep let me know. This would be a great future to have. Andras