Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
I am making custom formatter and want to integrate it with colorbox. I t works fine. But I can not figure out how to add slide functionality if thare are more than one picture attached. Could you pls help me with it?
function theme_custommy_formatter_table($variables) {
//dpr($variables);
$header = array(t('Preview'), t('Attachment'), t('Size'));
$rows = array();
foreach ($variables['items'] as $delta => $item) {
$opt = array('image/jpeg', 'image/gif', 'image/png');
if (in_array($item['filemime'], $opt)) {
$preview = '<a class="colorbox" href="' . file_create_url($item['uri']) . '"><img src="' . image_style_url('thumbnail', $item['uri']) . '"></a>';
}
else
{ $preview = '';}
$rows[] = array(
$preview,
theme('file_link', array('file' => (object) $item)),
format_size($item['filesize']),
);
}
return empty($rows) ? '' : theme('table', array('header' => $header, 'rows' => $rows));
}
brgds
Comments
Comment #1
frjo CreditAttribution: frjo commentedThe Colorbox plugin will group all links with the same rel attribute value.
Comment #2
Oleksa-1 CreditAttribution: Oleksa-1 commentedInteresting. Thx a lot, I will give it a try.