Can't use colorbox-load with external content

Created on 27 April 2017, over 7 years ago
Updated 16 January 2023, almost 2 years ago

I would like to load a page from an external site within a lightbox. It seems I should be able to do this in Drupal with colorbox and/or colorbox-load but it doesn't seem to be working.

I'm not exactly sure what the best way to do this is, but documentation on the colorbox project suggests that it can be done by installing colorbox and colorbox-load and adding class="colorbox-load" to the relevant link elements. Then again, there isn't any mention of this method on the project page for colorbox-load itself, so I'm not sure - maybe that documentation is out of date. Is this the right way of achieving this?

I can use colorbox to open a page on my own site in a lightbox by tagging the link element with class="colorbox". When I do the same on an external URL a lightbox opens but its only content is a line of text saying "This content failed to load.". When I try to do it using colorbox-load by adding class="colorbox-load" to the element, no lightbox is opened at all and the link just functions as a normal link, for both internal and external links.

I have put a test page demonstrating the issue here: http://winfordmanor.nfshost.com/colorbox-load-test

Here's the source of that page:

<p><a class="colorbox" href="rooms/?width=500&amp;height=500&amp;iframe=true">colorbox internal link</a></p>

<p><a class="colorbox-load" href="rooms/?width=500&amp;height=500&amp;iframe=true">colorbox-load internal link</a></p>

<p><a class="colorbox" href="http://www.example.com/?width=500&amp;height=500&amp;iframe=true">colorbox external link</a></p>

<p><a class="colorbox-load" href="http://www.example.com/?width=500&amp;height=500&amp;iframe=true">colorbox-load external link</a></p>

The page is in full HTML format.

Colorbox and Colorbox-load are both installed and enabled. I'm using Colorbox 8.x-1.2, Colorbox-load 8.x-1.0-rc2, and Drupal 8.2.6.

Thanks for any help.

Feature request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024