Yii 1.1: lyiightbox

This widget encapsulates LightBox2 script.
10 followers

Install

For install lyiightbox you have only to copy his files in /protected/extensions/lyiightbox folder.

Simple Usage

To use this widget with one image:

<?php
            $this->widget('ext.lyiightbox.LyiightBox2', array(
                'smallest' => '/path/to/thumb/images.jpg',
                'biggest' => '/path/to/biggest/image.jpg',
                'title' => 'Sample Image 1.'
            ));
?>

Hide Images

If you want, you can also hide some image with "visible" option. By default visible is set to true.

<?php
            $this->widget('ext.lyiightbox.LyiightBox2', array(
                'smallest' => '/path/to/thumb/images.jpg',
                'biggest' => '/path/to/biggest/image.jpg',
                'title' => 'Sample Image 1.'
            ));
            $this->widget('ext.lyiightbox.LyiightBox2', array(
                'smallest' => '/path/to/thumb/images.jpg',
                'biggest' => '/path/to/biggest/image.jpg',
                'title' => 'Sample Image 1.',
                'visible' => false
            ));
?>

Grouping Images

If you put more images in the same group, you can just show the first one and hide the others. The others must have the same group name. By default, all images stay in "_" group. If you want, you can specify it:

<?php
            $this->widget('ext.lyiightbox.LyiightBox2', array(
                'smallest' => '/path/to/thumb/images.jpg',
                'biggest' => '/path/to/biggest/image.jpg',
                'title' => 'Sample Image 1.',
                'group' => 'sample'
            ));
            $this->widget('ext.lyiightbox.LyiightBox2', array(
                'smallest' => '/path/to/thumb/images.jpg',
                'biggest' => '/path/to/biggest/image.jpg',
                'title' => 'Sample Image 1.',
                'visible' => false,
                'group' => 'sample'
            ));
?>

Change Log

v1.1.1RC (January 2nd, 2011)

  • some bug fix
  • changed licence

v1.0 (September 27th, 2011)

  • created extension

Total 11 comments

#16173 report it
yasen at 2014/01/26 03:34am
Demo

Hi sensorario, please include a demo of the gallery. Thanks.

#7252 report it
sensorario at 2012/03/07 06:45am
Lyiightbox is now up to date

I've fixed the path bug. Thank you!

#7246 report it
oatcpe at 2012/03/06 01:16pm
Please Fix CSS

the real path of prev and next button is

url(../lyiightbox2images/nextlabel.gif) url(../lyiightbox2images/prevlabel.gif)

#6017 report it
sensorario at 2011/12/06 04:22am
The issue?

The issue is "render images stored in a database"?

#6016 report it
enfield at 2011/12/05 11:03pm
thumbnail size :: thumbSide

sensorario, since thumbSide is part of Galleryii I don't see that as a solution to my question. I have not been able to get Galleryii to work with a database. No problems with using it as you have it built but would really like to take advantage of this extension with db files if possible. Thanks

#5907 report it
sensorario at 2011/11/23 06:36pm
thumbSide

To set dimensions of thumbnails you have to set thumbSide parameter.

#5858 report it
enfield at 2011/11/21 12:48am
thumbnail size?

If I am displaying images from my db can I somehow set the thumbnail size?

<?php $this->widget('ext.lyiightbox.LyiightBox2',array(
         'thumbnail'=>$this->createUrl(
                'displaySavedImage',array('id'=>$model->primaryKey)),         
         'image'=>$this->createUrl(
                'displaySavedImage',array('id'=>$model->primaryKey)),
            ));?>

Also is there a way to use Galleryii to render images in the db?

Thanks for the extension.

#5696 report it
sensorario at 2011/11/02 04:29pm
Fixed issue #15

Thank you for your contribute DavidTran: I've just added rc1.1.1

Fix is visible here: github.com/sensorario/lyiightbox

#5685 report it
David T at 2011/11/01 02:57pm
I got this error

I copy lyiightbox to extensions folder and use this code to display widget:

<?php $this->widget('ext.lyiightbox.LyiightBox2',array(
                'thumbnail'=>getImage($product->image,'images/content/',200,200),
                'image'=>'images/content/'.$product->image,
                'title'=>$product->name,
            ));?>

But widget don't show on my website, it throws this error: Uncaught ReferenceError: lyiightboxAssetUrl is not defined

#5224 report it
sensorario at 2011/09/23 11:50am
next version 1.1

In next version (you can see it in github) there will be a new class and new features: Galleryii. I think this will be done within 30 of this month.

PS. ChangeLog is the first title :-p

#5219 report it
Maurizio Domba Cerin at 2011/09/23 05:02am
new version

As there is a new version of the extension, would be nice if you include a changelog.

Leave a comment

Please to leave your comment.

Create extension