Active
Project:
fancyBox
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2010 at 07:08 UTC
Updated:
2 Jan 2011 at 09:51 UTC
I'd like to suggest to add the following code to fancybox.module in order to make Ubercart to consider Fancybox as a possible image widget:
/**
* Implementation of hook_uc_image_widget().
*/
function fancybox_uc_image_widget() {
$widgets = array();
$widgets['fancybox'] = array(
'name' => t('Fancybox'),
'callback' => 'fancybox_uc_image_widget_impl',
);
return $widgets;
}
/**
* This function generates the fancybox-specific HTML attributes.
*/
function fancybox_uc_image_widget_impl($rel_count) {
if (!is_null($rel_count)) {
$img_index = 'uc_image_'. $rel_count;
}
else {
$img_index = 'uc_image';
}
return ' class="imagefield-fancybox" rel="'. $img_index .'"';
}
I tried to to push this in Ubercart core (#903118: Fancybox image widget support) but this proposal was rejected. :)
Comments
Comment #1
walktalker commentedThumbs UP for maximpodorov!!
Thank you for the code, and I'm happily using the fancybox with Ubercart Product Image now!
Hopefully this code can be in fancybox next release.