Hi

hope you understand my bad english. Sorry.

I used Colorbox manually in a node.tpl.php file. Printet out an image manually like this:

<a class="colorbox-load" href="<?php print file_create_url($item['uri']); ?>"><?php print theme('image_style', array('style_name' => 'thumb_micro','path' => $item['uri'],'alt' => $item['alt'],'title' => $item['title'])); ?></a>

The colorbox is showing up. Everything fine so far, but it dosn't shows the Caption.
The HTML-Output of the picture looks fine:

<a class="colorbox-load init-colorbox-load-processed-processed cboxElement" href="http://dev-soudronic.selfip.net/sites/default/files/products/bild/1140_seam_product.jpg">
<img title="Semi-Automatic Powder & Curing System" alt="Semi-Automatic Powder & Curing System" src="http://dev-soudronic.selfip.net/sites/default/files/styles/thumb_micro/public/products/bild/1140_seam_product.jpg">
</a>

And if i click the picture, colorbox is showing, but the cboxTitel div for the caption is empty:

<div id="cboxLoadedContent" style="display: block; width: 770px; overflow: auto; height: 649px;">
<img id="cboxPhoto" width="770" height="649" src="http://dev-soudronic.selfip.net/sites/default/files/products/bild/1140_seam_product.jpg" style="border: medium none; display: block; float: none; margin-left: auto; margin-right: auto;">
</div>
<div id="cboxLoadingOverlay" class="" style="height: 677px; display: none;"></div>
<div id="cboxLoadingGraphic" class="" style="height: 677px; display: none;"></div>
<div id="cboxTitle" class="" style="display: none;"></div>

Is there a way to give colorbox some preferences if i print the picture out in my node.tpl.php file?

I also used the colobox on other pages, where i managed the output over the «manage field» page, and everything is working wonderful.

Regards
Pierre

Comments

hutch’s picture

I think you need to get title="Semi-Automatic Powder & Curing System" into the anchor tag, eg

<a class="colorbox-load init-colorbox-load-processed-processed cboxElement" href="http://dev-soudronic.selfip.net/sites/default/files/products/bild/1140_seam_product.jpg" title="Semi-Automatic Powder & Curing System"  >

Looking at the drupal api, file_create_url() does not support adding attributes so you may have to work around that somehow. The function l() does allow you to add stuff though, see api.drupal.org for details.

mortona2k’s picture

I am having trouble getting this to work. Maybe because I'm using colorbox-inline and the setup is different. Where do I find documentation about titles and classes on links and popup content?

frjo’s picture

Status: Active » Closed (fixed)