Hi, is is possible to show only specific content from a page in a colorbox when using the colorbox-load colorbox-inline?

For example I have a page with a single line of text. I want ONLY this text to display inside the colorbox, and not my whole page (navigation, footer etc).

Thanks!

Comments

frjo’s picture

That is exactly what "colorbox-inline" is for.

From the README:

Load inline content in a Colorbox:
----------------------------------
Check the "Enable Colorbox inline" option in Colorbox settings.

This enables custom links that can open inline content in a Colorbox.
Inline in this context means some part/tag of the current page, e.g. a div.
Replace "id-of-content" with the id of the tag you want to open.

Add the class "colorbox-inline" to the link and build the url like
this "?width=500&height=500&inline=true#id-of-content".

remkovdz’s picture

Thanks, but when I use that, it shows me the content within the DIV of the current page, not the linked page?

frjo’s picture

If you need to show content from another page than the current "colorbox-inline" is not for you.

The function you want is supported by the Colorbox plugin, see here:

https://groups.google.com/d/topic/colorbox/GnEAbkjekMk/discussion

There is no "point and click" support for it added to the Colorbox module yet so you will need to write some JS code yourself.

remkovdz’s picture

Great link, thanks!

frjo’s picture

Status: Active » Closed (fixed)
HyperD’s picture

I'm interested also on this, but the link #3 is not longer reachable.
I cannot add javascript into any page/view due internal policies, thus I'm looking for something feasible with Colorbox

benjus’s picture

Issue summary: View changes

Hi there,

I'm trying to show a template inside a colorbox popup in Drupal 7.

The link that call the template is this:
print "<a class='casualty-link colorbox-inline ' href='/timeline/casualties-popup/".$conflict."/".$fullDate."'>$casualties[$currentDayPadded]</a>";

Inside the js addede to the tpl I have this line:

$('a.casualty-link').colorbox();

But it is not working, open the page in other in another page.

Do you know why?