An Alternative Really Easy Image Gallery
==========================================
---------------------------------
Edited: 2006-02-18
As I cannot change the attachments you should note that changing the following line of CSS for '.thumbs' means resizing of text is much better with the spacing based on ems.
e.g.
.thumb {
margin: 1em 1em 1.6em 0; /* Space between images */
---------------------------------
Ok, I saw RedGuys beta and I thought brilliant!!!
...And then I thought I could do with some other options

So I began creating a different version. All credit should go to the originators
So what were my aims ?
1. Use the name of the images as a caption. Make it flexible captioning and also be able to independently set the 'title' and 'alt' tags.
2. The ability to change the surrounding 'div id' to allow for different CSS and hence styles for different galleries
3. Add 'classes' to various elements, again to allow styling. Thumbnail images and the big image can be formatted separately.
4. CSS and 'div' based rather than tables. Follow accessibility and web standards.
5. Make more photo gallery like - although you can make your own style with CSS.
See the attachments to this post:
Copy the 'ImageGalleryPHP.txt' code into a 'User Defined Tag'. I would suggest you name the tag 'ImageGallery' to keep things the same. You will also need to paste the CSS code from the 'ImageGalleryCSS.txt' to your main CSS page or one that is loaded by the page you put the tags in. (The CSS is only for an example and can be changed.)
There is no JavaScript - you do not need it - no pop-ups.
You should name your images carefully and then upload them to a directory on your web site using the 'Image Manager' in CMS Made Simple. (This automatically creates the thumbnail images.) One directory per gallery seems to make sense.
You can then apply this code to your page using:
Code: Select all
{ImageGallery picFolder="uploads/images/yourdir/"}
Where 'yourdir' is the directory you just uploaded your images to. It can be as simple as that or you can use some of the options...
Options
1. picFolder e.g. picFolder="uploads/images/yourdir/"
Is the path to the gallery (yourdir) ending in'/'
So you can have lots of directories and lots of galleries.
2. divID e.g. divID ="imagegallery"
Sets the wrapping 'div id' around your gallery so that you can have have different CSS for each gallery. The default is 'imagegallery'.
3. sortBy e.g. sortBy = "name" or sortBy = "date"
Sort images by 'name' OR 'date'. No default.
4. sortByOrder e.g. sortByOrder = "asc" or sortByOrder = "desc". No default.
5. bigPicCaption e.g.
bigPicCaption = "name" (filename excluding extension)
bigPicCaption = "file" (filename including extension)
bigPicCaption = "number" (a number sequence)
bigPicCaption = "none" (No caption)
The Default is "name". This sets caption above the big (clicked on) image to the above.
6. thumbPicCaption e.g.
thumbPicCaption = "name" (filename excluding extension)
thumbPicCaption = "file" (filename including extension)
thumbPicCaption = "number" (a number sequence)
thumbPicCaption = "none" (No caption)
The Default is "name". This sets the caption below the small thumbnail images to the above.
7. bigPicAltTag e.g.
bigPicAltTag = "name" (filename excluding extension)
bigPicAltTag = "file" (filename including extension)
bigPicAltTag = "number" (a number sequence)
The Default is "name". Sets the 'alt' tag for the big image - compulsory.
8. bigPicTitleTag e.g.
bigPicTitleTag = "name" (filename excluding extension)
bigPicTitleTag = "file" (filename including extension)
bigPicTitleTag = "number" (a number sequence)
bigPicTitleTag = "none" (No title)
The Default is "name". Sets the 'title' tag for the big image.
9. thumbPicAltTag is the same as bigPicAltTag (7) but for the small thumbnail images
10. thumbPicTitleTag is the same as bigPicTitleTag (8) but for the small thumbnail images. Except that after the options you have '... click for a bigger image' or if you do not set this option. You get the default of 'Click for a bigger image...'
An Example:
'div id' is 'cdcovers', no Caption on big images, thumbs have default caption. 'alt' tags for the big image are set to the name of the image file without the extension and the big image 'title' tag is set to the same but with an extension. The thumbs have the default 'alt' and 'title' tags. The default being the name of the image file without the extension for 'alt' and 'Click for a bigger image...' for the 'title',
Would be:
{ImageGallery picFolder="uploads/images/cdcovers/" divID="cdcovers" bigPicCaption="none" bigPicAltTag="name" bigPicTitleTag="file"}
It's got lots of options but I wanted to keep it very flexible and you don't have to set them, the defaults are sensible.
(You should note that several options from the original have been removed because they are not needed or do not follow accessibility or web standard guidelines)
Check out the XHTML produced and CSS code for formatting options.
Examples are here:
http://www.cms.shoesforindustry.net/cms ... lerya.html
and here:
http://www.cms.shoesforindustry.net/cms ... leryb.html
I'd appreciate a bit of testing and feedback
Thanks to RedGuy for the brilliant idea!
Enjoy...
Russ
[attachment deleted by admin]