I’ve been playing around with image lightboxes and I need the image caption to be visible when the user enters the lightbox view. I’ve managed to do this using Link > Action > Lightbox > Caption workflow.
But I’m struggling to show the image caption when activating the lightbox through the “Lightbox” toggle on the image itself.
This “more direct” workflow would clearly be the better solution for my use case, but I haven’t figured out how to make it work.
I’ve tried defining the image alt text inside of cwicly as well as in the wordpress media library itself (caption and description fields for the image in question), but that hasn’t helped unfortunately.
Does anybody know how to show the image caption using the lightbox toggle on the image itself? Any help would be greatly appreciated.
Are there any other details I should provide? After a couple of days I haven’t found a way to solve this issue, unfortunately.
If this is simply not possible in cwicly, that would already be a sufficient answer But if there is a way, then it would be amazing to know about, for future projects as well.
@marc you need to wrap that image in a div and set the div with a link > action and point to the same image. You will see more options appear with the link selection. Make certain to turn off the lightbox toggle on the image block itself, only the linked div:
I was already using the solution you described, that’s what I meant in my original post – sorry if that was not clear enough.
I was hoping there would be another way to go about this issue because right now (using the div wrapper and link action) I have to specify the image src twice, once on the img element itself and once in the lightbox link action. This is in no way a critical issue, but if there’s a more elegant solution, then I’d definitely prefer it for maintainability reasons.
That’s why I was trying to make the lightbox work with the lightbox toggle on the image itself, that would allow me to only specify the img src once. If I didn’t need the caption in the lightbox, that would be my go-to.
But since I do need the caption in my current use-case, I guess I’ll implement the solution you suggested, thanks @hopscotch!
If anyone has found a way to show the caption using the lightbox toggle on the image itself and would like to share, that would be awesome
Hi @hopscotch, setting the fields to dynamic was something I considered as well, but in my case the dynamic values don’t come from ACF (or sth similar) but from a cwicly component that my clients will edit inside the cwicly editor itself.
And setting the link lightbox fields to dynamic does not (yet?) seem to enable the connection to component properties, unfortunately.
I’ve reached out to support to see if there are any other alternatives