I have Colorbox set up and also enabled the colorbox load and inline options. The library is in the module folder (not in a folder off of the root).

Outside of ckeditor content, colorbox works perfectly. It also works in Paragraphs image fields.

I cannot get it to work for any images entered within text areas using ckeditor, even when manually adding the "colorbox-inline" class to the images.

Best I've been able to achieve is getting a popup which looks as if it's trying to load an image.

It would mean a lot more content flexibility if I could have images throughout text that could pop up in a colorbox gallery rather than having them segregated to one area of the content page.

Am I just misunderstanding the function of the colorbox inline option?

I'm having the same issue with the D9 site which uses separate modules for colorbox_load and colorbox_inline.







indigoxela's picture

Hi DanM,

I'm not sure if Colorbox should work that way, but I'm able to get images in content working as a gallery.

That's far from convenient, though:

  • Add an image in content
  • Add a link around that image
  • That link points to the image (src)

The third step is the inconvenient one (fiddle out the image path).

Note: I didn't enable colorbox-inline, just used regular colobox.

Thanks, Indigoxela. I finally got it working a little, but as you say, it's far from convenient. Seems that the link part is necessary, which could make it doable, but the image pops up without the caption and there is no option to view the next image within the content. It works on my Drupal 9 livesite, though. Maybe I can deconstruct what I did to get it working there. Not giving up yet.


indigoxela's picture

Wait a minute... there's a module for that: Image Resize Filter

Install the module (in addition to Colorbox), enable the filter for your format, for example on /admin/config/content/formats/filtered_html, check to add a link automatically, class "colorbox", (rel "colorbox"), save.

Eventually flush caches (for existing content). Works! (If images get resized in the editor)

That works -  THANK YOU!

In all my searches, I never came across that.

Now I only need to figure out how to get the caption to display with the images. :-)


I got it working, thanks to the module you suggested, but couldn't get captions to show. I added a paragraphs collection (images and long text) and when I add images and text this way, everything works. I was hoping to keep it all very simple, but with planning, I think this can work to allow content variety and flexibility without too many complications.

Thanks so much for your suggestions!

Nothing I tried would show captions in images added into ckeditor. I've been building my site side-by-side with both Backdrop and Drupal 9. The only way I could make it work with ckeditor in Drupal 9 was to use the embed module with ckeditor. It took a ton of experimentation - with both Backdrop & Drupal, the image config. options are everywhere.

The best backdrop option (and a decent one) was to use paragraphs and have a few instances of a paragraph set up as: image-long text-image.  Not exactly as flexible, but it works.

I'm going to continue the side-by-side setup. I do like the backdrop interface and it has a lot of nice enhancements over Drupal 7 without all the heaviness / extra learning curve of Drupal 8/9.