This extension adds a simple photo gallery.
Photo links can be enhanced to include lightbox or similar by editing views\gallery.php
. CSS is located at css\gallery.css
.
Makes use of Yii's Cache if available. Currently you will have to clear the cache manually.
Properties
- name = The name of the gallery
- path = The path to the directory containing the albums (relative to webroot)
- id = the #ID of the gallery container
- showNav = Show the navigation menu
- mimeTypes = Mime types to display
- createThumbnails = Or use a generic icon
- thumbnailWidth = The width of generated thumbnails
- thumbnailHeight = The height of generated thumbnails
- displayFoldersAsDates = Album folders that are in a format parseable by strtotime should be displayed as a formated date
- dateFormat = The date format used for output (only used if foldersAreDates = true)
- imagesPerPage = The number of images to show on each page
- imagesPerRow = The number of images to show on each row
- albumsPerPage = The number of albums to show on each page
- albumsPerRow = The number of albums to show on each row (0 for unlimited)
- sort_order = Album sort order (asc/desc)
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions
Usage ¶
Choose a location to store the photos: eg. /images/gallery Ensure that this location is writable by the webserver (if you want thumbnails generated for you).
Create some "albums" in the gallery and put your photos (and optional description.txt) in there eg.
+-images/
+-gallery/
+-sample/
| +-image1.jpg
| +-image2.jpg
+-sample2/
| +-image4.jpg
| +-image5.jpg
+-sample3/
+-description.txt
+-image6.jpg
+-image7.jpg
If you name your folder by date (eg. 20091120) and create a description.txt you can sort your gallery by date, but show whatever album title you want.
Format of description.txt ¶
Line 1: Album title
Lines 2-n: Album description
Album title
An optional description of the album that will be parsed by Markdown.
It can have multiple lines.
Add the following code to your view:
$this->widget('application.extensions.gallery.EGallery',
array('path' => '/images/gallery',)
);
Change Log ¶
November 20, 2009 (1.0) ¶
- Initial release.
November 21, 2009 (1.1) ¶
- Fixed up CSS styling to be more specific.
November 28, 2009 (1.2) ¶
- Fixed problem occurring when Yii is installed to a subdirectory.
- Able to correctly set path relative to Yii install as well as relative to webroot.
December 18, 2009 (1.3) ¶
- Added cache support.
- Fixed problem where there would be a long pause while the server generated the thumbnails.
Good Work, Keep moving forward, please.
It is a working extension for my webapp. However, the requirements for photo gallery could be various. I would like to suggest you to improve it further to cover some more important features.
BTW, my development is XAMPP in Windows, I met some issues in Windows shell execution during generating thumbnail. I have to manually generate them by imagemagick.
MarkDown works, but does it work for UTF-8 for CKJ Languages?
load from the model
it will be a great thing if you will use an array of links instead loading everything from the fs
Excellent Gallery
It would be cool to see this use a CDataProvider like the DataGrid widget.
Path to gallery is not specified or invalid.
CException
Path to gallery is not specified or invalid.
C:\xampp\htdocs\WebSite\WebSite\Web2\Final\hkz\protected\extensions\gallery\EGalleryBase.php(165)
Merged this extension with fancybox2, and it becomes fancy...!!!
Install this extensions.
Get and install Fancybox2
Open and edit your "gallery.php" file, add this following lines:
<?php $this->widget('application.extensions.fancybox.EFancyBox', array( 'target' => '.egallery a', 'config' => array(), )); ?>
Demo is failing....
Demo is not working. Link to it is broken: http://www.mcmillan.id.au/dev/yii.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.