AD Gallery Wrapper Extension


(Corey) #1

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

http://www.yiiframework.com/extension/adgallery/

Please comment with recommendations, problems, etc!


(Ipulxd) #2

I got problem with ad-image-wrapper height when using adgallery package from your extension download. So I try to download js and css package from http://coffeescripter.com/code/ad-gallery/ then it works great.

Thanks for your great job.


(Corey) #3

Thanks for helping me test! I think I know the reason for this: in the ad-gallery sample code, some dimensions are set in the HTML, some are set by javascript, and some are set by CSS. I set all sizes with javascript in the onready section so that all of these sizes can be passed to the widget in one place (instead of some to the widget, some to css, etc). I did not explicitly set the size of the wrapper properly, nor did I explicitly set the size of the div containing the thumbs. However, the css included in the ad-gallery source does set these, which is why (I think) it worked after you re-downloaded CSS.

In version 1.0.1 (just uploaded) I set the size of the iamge wrapper specifically and set the size of the thumb container to the outerHieght(true) of the thumbnail images after the widget resizes them (if specified), so that it will be as big as the thumb, any borders, margins, and paddings.

Please try it out (with the widget stylesheet instead of the ad-gallery stylesheet) and tell me what you think! Please let me know if it doesn’t work for you, and what browser/os you use.

I tested the widget in:

Firefox 3.6.13

Chrome 8.0.552.231

Safari 5.0.3 (6533.19.4)

And it works fine in all of these.


(Ub3d Armas) #4

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


(Corey) #5

You would put the code in your template file. The code should look something like this (as an 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',

            ),

        )

    );


(Ub3d Armas) #6

I have done that step, and the code that I put in protected / views / site / pages / about.php

but the error message is

Alias "ext.adGallery.AdGallery" is invalid. Make sure it points to an existing PHP file.

What should I do


(Corey) #7

In what folder do you have the extension right now? Please start at the application level and list the path, for example

myapp/protected/extensions/adGallery


(Mail) #8

Just copied the example widget code (see above) into protected/views/site/pages/about.php in order to make some first steps. Package 1.0.1 is installed in extensions folder of course.

I expected to see a nice photo gallery, but instead a vertical list of large original sized pictures - given by imageList array - with HTML bullet points in front appears. I’m troubleshooting for a while now trying to understand AdGallery .php and .js files but I don’t see any obvious mistake I made.

What went wrong? Any ideas?


(Corey) #9

It sounds like it is not properly registering or publishing the CSS files. Are you using the default CSS file? If so, can you check to see if your page is including jquery.ad-gallery.css?


(Mail) #10

Thanks for your quick response and helping solve the issue! You are right, the CSS file was not published in the assets folder because of wrong write/read access options for the subfolders under assets.


(Corey) #11

So we are all good? I just want to make surte before I just assume ;)


(Farocco) #12

what if you want to read an unknown number of images in a directory?

Can this be done with this extension?

Thanks


(Corey) #13

Yes, but indirectly. You would read in the directory in php, make an array, and pass the array of image names to the extension. The extension does not know your directory structure or how it relates to your assets and the publishing of those assets. This function should help you get there:

http://www.php.net/manual/en/function.scandir.php


(Mail) #14

Yep :wink:


(Balint2005) #15

Is it possible to load information for image url and title from a data provider as I have the file names in a database?


(Tuxposta) #16

hello, i use this extension and looks fine

i need to get active image name or path from adGallery. how to i get it ?

thanks for any suggestion