Hi,
I have been using Jquery Fancybox alot:
fancyapps.com/fancybox/
So - I wanted to add it to the Flexicontent image plugin - so my images would pop up.
1. Add the popup option to image.xml (plugins/flexicontent_fields/images/image.xml)
Find on line 102:
Code:
<field name="popuptype" type="list" default="1" label="FLEXI_FIELD_IMAGE_POPUP_TYPE" description="FLEXI_FIELD_IMAGE_POPUP_TYPE_DESC">
<option value="1">FLEXI_FIELD_IMAGE_MULTIBOX</option>
<option value="2">FLEXI_FIELD_IMAGE_ROKBOX</option>
<option value="3">FLEXI_FIELD_IMAGE_JCEMEDIABOX</option>
</field>
2. Add your value before </field>:
Code:
<option value="4">FANCYBOX</option>
3. Open image.php (plugins/flexicontent_fields/images/image.php)
Scroll Down to line 422 looking for $popuptype == 3:
Code:
} else if ($usepopup && $popuptype == 3) {
$field->{$prop} = '
<a href="'.$srcl.'" class="jcepopup" rel="'.$field->item_id.'" title="'.($desc ? $desc : $title).'">
<img src="'. $src .'" alt ="'.$alt.'" />
';
After this install your code:
Code:
// Fancybox
} else if ($usepopup && $popuptype == 4) {
$field->{$prop} = '
<a href="'.$srcl.'" class="fancybox-thumb" data-fancybox-group="gallery" title="'.$alt.'">
<span class=zoom"></span><img src="'. $src .'" alt ="'.$alt.'" />
';
You need to insert the jquery in your template by following the Fancybox website code.
I used the following code at the bottom of my template:
Code:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery(".fancybox-thumb").fancybox({
prevEffect : 'none',
nextEffect : 'none',
helpers : {
title : {
type: 'inside'
},
overlay : {
opacity : 0.8,
css : {
'background-color' : '#000'
}
},
thumbs : {
width : 50,
height : 50
}
}
});
});
</script>
Hope somebody finds this helpful.
Robert