You want to know the weird thing- the position and style you see the caption was already built by Webflow into the lightbox. I’m just populating that element from the alt text.
My guess is that they started building the feature and then stopped to reconsider designer requirements on styling, links, multiline text… went down some rabbit holes… got lost in requirements… and then shelved it for a later date while they work on more critical things.
thank you for this. Webflow’s original non CMC lightbox always had captions. Not sure why their CMS never had option. I added a simple if condition so that if an ‘alt’ isn’t present it doesn’t give the undefined error. As videos don’t have them. But this is awesome will share this wide.
Thanks Jeremy, the library should ignore videos successfully, I had the same issue on a project as well- but you might have found a case it doesn’t detect successfully.
If you can find a situation where you can create an undefined result in the caption please share it in the Sygnal Attributes forum here, would like to add that improvement to the list.
That makes a lot of sense- it’s probably the HTML structure I’m seeing emitted.
Hi Michael, it was from the clone actually. I was mixing a bunch of galleries together though. Used the template page so I could test combination of the main image, video, and a collection list of additional images from multi-image fields. wrapped the caption bit in if (caption) {
} worked like a charm. I was so happy I didn’t have to figure this our from scratch.