Hi,

Please can you tell me how to launch an external url say "google.com" in a colorbox from my drupal 7 node ?

Thanks

Comments

frjo’s picture

Here are some examples:

<a class="colorbox-load" href="http://google.com/?width=950&height=500&iframe=true">open Google in Colorbox (iframe)</a>

<a class="colorbox-load" href="http://google.com/?iframe=true">open Google in Colorbox (iframe)</a>

Remember to enable Colorbox load in the Colorbox configurations.

rolandk’s picture

Thanks very much !

viny-1’s picture

Hi,

Starting with Drupal, can you tell me where am I supposed to add this link ? I guess in a css file somewhere, but I have no clue how css works...

I have checked eRecruiter and there are heavily using this module, I would love to be able to show external web site like them automatically...

Thanks a lot

Viny

rolandk’s picture

Make sure you install this colorbox mod in drupal.
Turn on colorbox in admin settings

When you create content, just
* set the content type to Full HTML
* add a link like this to the content body

<a class="colorbox-load" href="http://google.com/?width=950&height=500&iframe=true">open Google in Colorbox (iframe)</a>

Preview or open your content.

viny-1’s picture

Thanks a lot, works like a charm.
Is it possible to add a link directly from a menu or from a link field ?

Actually, if the user is going to enter the content by himself, he should enter http://www.google.com, and the link would be automatically updated to the link with the colorbox iframe

I have no idea if this is doable.

Viny

rtdean93’s picture

This is working for me - but when I call the external URL - the paths are causing trouble.

The external link I am trying to call is http://therock.ccbchurch.com/w_form_response.php?form_id=510

And when I have <a class="colorbox-load" href="http://therock.ccbchurch.com/w_form_response.php?form_id=510/?width=950&height=500&iframe=true">open Page in Colorbox (iframe)</a> - I get a redirect page - since the external link is trying to parse the URL.

Any suggestions on a workaround?

hutch’s picture

You have two question marks in the query string and a slash getting in the way, try

<a class="colorbox-load" href="http://therock.ccbchurch.com/w_form_response.php?form_id=510&width=650&height=760&iframe=true">open Page in Colorbox (iframe)</a>

I have adjusted the dimensions to get rid of the scrollbars (at least for me)

A question mark denotes the start of a query string, the ampersands delimit the key-value pairs, you were getting a redirect probably because w_form_response.php (re)started on the second '?' and could not make sense of it.

rtdean93’s picture

Thanks - it works great

frjo’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tomas.teicher’s picture

I tried to create link as follows:

<?php
l('Google', 'http://google.com?width=950&height=500&iframe=true', array('attributes' => array('class' => 'colorbox-load')));
?>

The resulted link looks like this:

<a href="http://google.com?width=950&amp;height=500&amp;iframe=true" class="colorbox-load">Google</a>

When I click on the link, colorbox is shown but it is empty. When I look in code in firebug, I see such content of colorbox:

<html>
<head>
</head>
<body>
</body>
</html>

So no content was loaded. When I replace "href" argument with some internal link, colorbox works ok. So the problem is only with external link. the url is correct, when I open it in browser in normal way without colorbox, google is loaded.

Could anybody help?

hutch’s picture

I think the problem lies with using google, not with colorbox, I just tried

<a class="colorbox-load" href="http://www.youtube.com/watch_popup?v=EVwlMVYqMu4&amp;width=520&amp;height=300&amp;iframe=true">A dogs dinner</a>

and it works fine.

BenjaminRH’s picture

I had this same problem. With a normal YouTube link. I'm just getting

<html>
<head>
</head>
<body>
</body>
</html>

Strangely, when I try switching the normal watch?v= to watch_popup?v= it works.

Yorgg’s picture

Everything is giving me white pages except #12 code that works with youtube except for google.
And I'm using the dev-version.

ps. I have Colorbox Load enabled. Where else should I be looking at?

bessone’s picture

Also with 6.x-1.1 to me give always a empty body.

Poieo’s picture

The only way I could get a Google Map to work in colorbox was to use their web element builder:

http://www.google.com/webelements/#!/maps

Using the link provided there (plus the colorbox variables appended) opened the map in a nice clean colorbox.

angelusnoctis’s picture

I also get a blank iframe when I try to open external URLs. ¿Any idea on how to fix this?

mordonez’s picture

same problem as angelusnoctis (colorbox 1.3).

gausarts’s picture

angelusnoctis’s picture

For me it is not working even with external URLs that are not from Google. Has anybody found a fix for this?

gbrands’s picture

To get it working with Google Maps, just append another variable: &output=embed

Worked for me!

aze2010’s picture

subscribing. Isn't working with external Links like Twitter, Google, and so on.

Ist it maybe not probably working with "Https (SSL) Links" ?I dont know ...