Streaming live at 10am (PST)

Adding lightbox to image in CMS rich text field


#1

Hi, I wondered if it was possible to add a lightbox feature to an image that has been added in a rich text field through the CMS? I have seen workarounds for using a lightbox for an image that is in a specific image field in the CMS but can’t seem to find anything that would work if it has been added in a rich text field.

Thanks


#2

Trying to do the same :frowning:


#3

Hmm that’s definitely a tricky problem to solve. I honestly can’t think of anyway to do this exactly how you want. The only solutions I can think of aren’t super practical, but may help:

​1. Turn the entire rich text element into a click trigger interaction. You can’t target just the image so you’d have to use the entire thing, then use interactions to set up a pop up modal / custom lightbox with the image inside
​2. Create two separate rich text fields. One field for above the image content, the other for after image content. Then add an image field to the collection and set your image as needed. Then you can structure the page like this:

From here you can create a custom lightbox using interactions and set the image as the click trigger to open the lightbox.

Beyond those two methods I can’t think of any other way to do this natively. Best of luck and let us know if you find a better solution! :slight_smile:


#4

Thanks for your help Brandon.