cmsdreams.co.uk » Forums » Content Module » How To - create an image gallery

cmsdreams.co.uk

Content Module

How To - create an image gallery

How To - create an image gallery

Posted: Wed Mar 20, 2013 4:37 pm
Author: mark Location: England
Want an image gallery on your website using the Content module? Here's how!

1. Create a Category

For general instructions on how to create a category read this :-

www.cmsdreams.co.uk/in...mp;mid=760

To create a category specifically to hold images, use these settings :-

Sub-Category Of = "Home" if it's a top level category, or whatever's appropriate for your site
Title = the name of this gallery
Image = leave this blank
Content = you'll probably want to display images in a grid format, so set this to something like 4 Across, 4 Down
Sub-Categories = if this category is going to have sub-categories set this the same as above
Display Sub-Category Items in Category Listing = No
Base Content Type = Image
Specific Content Type = Image
Template = image
Sort by = Date or whatever you prefer
Sort Order = Descending or whatever you prefer
Allow User to Change Sort = up to you

Click the Add button.

2. Adding images to the gallery

You can submit images to the gallery one at a time, but by far the best way to get images into the gallery is to upload several of them and use the Batch Process facility.

If your web server uses PHP version 5.3 or greater, and you have the ZIP extension loaded (check your server specs from Admin -> System -> System Info -> PHP Modules) you can upload a ZIP file containing lots of images and the batch process will unzip the file, extract all the images into the correct locations, and add them all to the gallery.

If you don't have PHP version 5.3 or you don't have the ZIP extension loaded you can still use the batch process, but you'll have to use an FTP program to upload the images, and the upload location (relative to your website root folder) will be uploads/Content/data/CATEGORY ID NUMBER.

Go to Admin -> Content -> Batch Process

Choose the category you just created as the gallery to add the images to.

If you have the facility to upload and extract a ZIP file the option to do so will be presented to you. Select the ZIP file from your computer and click the Upload and Extract button. After a while a message will appear telling you the file was uploaded and extracted (hopefully!).

Make sure Add New Images is selected and click the Continue button.

You should then see a list of the images it's processed, with a small thumbnail version of each. Every image has been added to the gallery and resized according to the settings for the "Image" content type.

Using non-default settings

You can change how images are processed by modifying the properties for the "Image" content type.

Go to Admin -> Content -> Types and click the edit link underneath the Image type in the list of types at the bottom of the page.

In particular you might want to change these fields :-

Thumbnail Name(s)
Thumbnail Width(s)
Thumbnail Height(s)

"Thumbnail Name(s)" is a comma separated list of prefixes that will be used to resize images. Given the default "normal_,thumb_,icon_" what will happen is each image will be resized 3 times, the first will be called "normal_imagename", the next "thumb_imagename" and the 3rd "icon_imagename". The original image will be left untouched.

If the list only contains 2 names only 2 resized images will be created, if it contains 1 only 1 etc. If the list is empty images are not resized at all.

The "Thumbnail Width(s)" and "Thumbnail Height(s)" fields contain a list of values to be used as widths and heights of the resized images, in the same order. So if "Width(s)" contained "640,128,64" (for example), "normal_imagename" will be 640 wide, "thumb_imagename" will be 128 wide etc. The same principle applies for the "Height(s)" field.

All times are GMT
Page 1 of 1
http://cmsdreams.co.uk/