This extension allows you to transform a list of images into an attractive gallery with scrollable thumbnails. Features include:
Events that accept javascript callbacks
Optional separation of thumb and big image for bandwidth optimization
Extremely customizable
This widget has been tested in the following browsers:
Firefox 3.6.13
Chrome 8.0.552.231
Safari 5.0.3 (6533.19.4)
Please leave a comment if you test it in any other browsers so that I can include them in this list (if they work) and fix them if they do not work!
1.0.1 Bug Fixes ¶
The ad-gallery jquery plugin uses javascript to set some sizes and css to set others. I tried to simplify this by setting all sizes with javascript so that they can be passed to the widget directly. Because of this, some browsers had an issue with the height of the main image not setting properly. This has been fixed in 1.0.1
The gallery slideshow autostarted even if agSlideShowAutoStart was set to false. This has been fixed in 1.0.1
Requirements ¶
Yii 1.1
Installation ¶
Unzip and move the adGallery folder to your extension folder.
Usage ¶
Simply provide a list of images in an array when calling the widget. The list can be simple or detailed, or you can mix simple and detailed in the same array. See the example:
$this->widget('ext.adGallery.AdGallery',
array(
'imageList' => array(
array(
'image_url' => 'images/1.jpg',
'thumb_url' => 'images/thumbs/t1.jpg',
'title' => 'Test tile',
'link' => 'http://www.google.com/',
'alt' => 'Something something',
),
array(
'image_url' => 'images/2.jpg',
'title' => 'Test tile sdfjaskdf',
'link' => 'http://www.msn.com/',
),
'images/3.jpg',
'images/4.jpg',
'images/5.jpg',
'images/6.jpg',
'images/7.jpg',
'images/8.jpg',
'images/9.jpg',
'images/10.jpg',
'images/11.jpg',
'images/12.jpg',
),
)
);
You can also specify size information if you wish:
$this->widget('ext.adGallery.AdGallery',
array(
'agWidth' => 450, //450 px wide main image
'agHeight' => 200, //200 px wide main image
'agThumbHeight' => 75, //75px tall thumb images
'agEffect' => 'slide-vert', //vertically slide between images
'agSlideShowAutoStart' => 'true', //Automatically start a slide show
'imageList' => array(...),
)
);
How to center the gallery
Someone sent me a message about centering the gallery. If you specify a classname or a css id for the widget, you can just put margin:auto on the class or id you specify and it will be centered. If you do not specify a classname you can use
.adGallery {
margin: auto;
}
in your css. I hope that helps!
how to use this extention
sorry
I am a beginner in Yii, how do I use this extension, because it is less clear explanation on the site, and also help in the path configurations include
above code is written in what files and directories
thank you
Where to put the sample code
You use the sample code snippets in your template (view) files
$agDisplayNextAndPrev is Private, not public
So, please change #159 AdGallery.php to fix it :D
Thank you!
How would I go about changing px to ems?
Hi, could you tell me how I might edit this so that it with my site, i.e. change to em measurement rather than px?
Re: How would I go about changing px to ems?
This is a yii wrapper around a jquery plugin that someone else developed. The px is hard coded in the javascript file, but you can change that inside
jquery.ad-gallery.js
Just make sure to compress your changes into the file
jquery.ad-gallery.pack.js
after you change to ems so that it is included correctly by the widget. I hope this helps
It needs correct permissions
I used the sample code and it can't move the JS file to /assets/
The widget registers the JS as following :
<script type="text/javascript" src="/assets/1369e66/jquery.ad-gallery/jquery.ad-gallery.pack.js"></script>
If your jquery.ad-gallery.pack.js cannot be found (404 error) and the "jquery.ad-gallery" folder stills empty on Linux you will have to recursively apply read-write permissions for "www-data" or "others" to /protected/extensions/adGallery
error in js : thumb_opacity: 0,7,
Problem is comma between 0 and 7
I had to specify agThumbOpacity directly for fix it
$this->widget('ext.adGallery.AdGallery', array('agThumbOpacity'=>'0.7'));
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.