Photo Gallery Documentation

In 2005, StopDesign released a powerful set of templates to produce a very professional looking photo gallery using Movable Type. Originally designed for his personal galleries, he made them available for download for anyone. However, the installation required the installation of numerous plugins and custom configurations. The Photo Gallery plug in was born to automate the installation and use of this gallery templates.

Table of Contents

Requirements

As far as software, Photo Gallery simply requires 2 things:

  1. Movable Type - The latest version of Photo Gallery requires MT 3.3. If you're running MT 3.2, you can download and use Photo Gallery 1.4 which lacks a few bug fixes and minor enhancements.
  2. The Image::Magick Perl module on your server.

That's it.

The templates designed by Stop Design do require a series of MT plugins, but Photo Gallery bundles those in the package so you don't have to gather them and install them yourself. You should, however, check the list to be sure that you don't already have any of them installed. Duplicate plugins can cause errors on your blog. The bundled plugins are:

  • Arithmetic
  • Category
  • MTCategoryOfArchive
  • MTCollate
  • Collect 1.2
  • Compare 1.1
  • Dirifyplus
  • Entry
  • Expressions
  • Filter Categories 1.1
  • FirstNWords 1.3
  • MTGrid
  • Keyvalues
  • PreviousNextInCategory
  • MTRelativeURL

If you do have any of them installed already, you can simply disable the current installation of that plugin from the main plugin page on your blog prior to installing Photo Gallery. Alternatively, you can install Photo Gallery and disable the duplicate within the Photo Gallery list.

Lastly, the style sheet provided with these templates assumes a default 4:3 (or 3:4) ratio for all photos. If your camera shoots at 1024x768, 1600x1200, 2272x1704, or some other equivalent 4:3 ratio, you.ll be fine. The included style sheet supports 480x360 (landscape) or 360x480 (portrait) for regular-size images, and 90x68 or 68x90 for thumbnail-size images. Other ratios or sizes require changes to style sheet values.

Installation

The easiest way to install Photo Gallery is to use the Plugin Manager - a Movable Type plugin that makes installation of plugins as simple as toasting bread. To install via Plugin Manager, simply download the Photo Gallery package from either link at the bottom of the page and upload into the Plugin Manager interface.

Can't use Plugin Manager or just don't want to? That's OK, you can install Photo Gallery manually as well. Here's how:

  1. Download Download the Photo Gallery archive to your PC's hard drive from one of the links at the bottom of the page.
  2. Extract the Files Using your favorite unzipping software, extract the contents of the file to your PC's hard drive. Make sure that the folder structure is maintained when the files are extracted, some zip programs just dump all the files in one place by default. That will make things very, very hard on you later. Refer to the help files for your zip program for further instructions.
  3. Prepare MT Check the 'mt-config.cgi' file (or 'mt.cfg' if you have not migrated to the new config file yet, which you should consider) to make sure that you have the 'StaticWebPath' configuration parameter set properly. If you are not running MT within your cgi-bin, you may have not set this parameter when you installed Movable Type. If so, set it now, following the instructions in the config file.
  4. Upload Upload the files you extracted to your MT installation keeping the same folder structure. That's really not as hard as it sounds. It simply means that the 'PhotoGallery' folder and all it's contents in the 'mt-static' folder of the archive goes into the 'mt-static' folder of your Movable Type installation and that the 'PhotoGallery' folder and all it's contents in the 'plugins' folder of the archive goes into the 'plugins' folder of your Movable Type installation. Two drag and drop operations in your FTP client and you're done.
  5. Configure Before you shut down your FTP client, navigate to the [MT-install-dir]/plugins/photogallery/ and find the 'gallery/cgi file. Set the permissions on this file to 755 or you will get errors when trying to use Photo Gallery.
That's it, now your ready to go.

Usage

Creating a new Photo Gallery

A Photo Gallery is simply a customized weblog. Creating a new Photo Gallery*, then, means just creating a new blog. However, this new web Photo Gallery isn't created through the main 'weblogs' page as any other would be.

Instead, to create a Photo Gallery go to the main page for any existing blog in your system and look for the 'Create Photo Gallery' link in the 'Plugin Actions' section, as shown. It doesn't matter what blog you start from to create the Photo Gallery blog. Don't worry, you are not creating a link between the blogs. This is simply where the Photo Gallery plugin places the link.

Create Gallery

After clicking the link, you'll be presented with the "New Photo Gallery Settings" page. Notice that it looks just like the "New Weblog Settings" Page? Enter the info required, and click 'Save Changes'. That's it. Now you're ready to start creating albums* and uploading pictures and using your new photo blog.

*Actually, on the published pages of your Gallery, both the entire photo blog and the albums are called 'Galleries', but to help keep things straight here (and on the Upload Photo screen), we're calling the blog a 'Photo Gallery' and the individual categories 'albums'.

Uploading Pictures

Each photo in your Photo Gallery get's it's own entry. You don't use the regular 'New Entry' screen to create an album entry, Photo Gallery has it's own interface for that. Look for the "Upload Photo to Gallery" link on the main page for you Photo Gallery blog, as shown. (Note: Because of the way that Moveable Type handles plug in actions, this link will be visible on every blog's page. It will only work properly, however, within your Photo Gallery blogs.

Upload Photo

When you click that link you will see the "Upload Photo" screen. This is a customized version of the "New Entry" screen with the following fields:

Upload Photo
  • Photo Title Corresponds to the MT "Title" field. Appears to the right of the photo on the individual pages.
  • Photo Album Corresponds to the MT "Primary Category". Photo Gallery uses Moveable Type categories to define individual albums. In your Photo Gallery, you can have as many individual photo albums, or categories, of pictures as you'd like. Also, you can assign a Photo to multiple categories, but the 'next' and 'previous' links on it's main page will still point to the other photos in its main album. There is a way around this that we'll talk about later.
  • Caption Corresponds to the MT "Excerpt" field. Text that will appear to the right of the photo on the individual pages, under the title.
  • Keywords Corresponds to the MT "Keywords" field. Appears to the left of the photo on the individual pages.
  • Photo to Upload Path to the photo on your local computer. Click the browse button to select a photo to upload. There is a limit in MT for uploading files. This is set in your mt-config.cgi file with the parameter 'CGIMaxUpload'. By default this is set for 1000000, or 1MB. Files over that setting can not be uploaded and will generate an error screen. This field is only available on this screen.
  • Accept Comments Corresponds to the same field and function in MT. Note that there is not support for either trackbacks or Typekey built into Photo Gallery. It should be possible to integrate that by editing the templates if you'd like.

Once the 'Save' button is clicked, Photo Gallery creates an entry in your Gallery for that photo. Photo Gallery uploads the image to your server and creates the main and thumbnail versions automatically. In previous versions of Photo Gallery, the MT Preview was retained on the "Upload Photo" screen. Because of limitations with MT's preview functionality, this is not useful with Photo Gallery so it was removed with the version for MT 3.3, Photo Gallery 1.7. If using previous a version, don't use the Preview button.

The image file as is is uploaded to the server as is, but that photo is not directly linked in the blog. So there's no need to reduce your photos to the 480x360 (landscape) or 360x480 (portrait) size prior to upload, as long as it is under the maximum upload size. For the main photo on the individual page, it is then converted to 480 x 360 (or 360 x 480) and the file name is appended with '-photo'. For the thumbnails, it is converted to 90 x 67 (or 67 x 90) and the file name is appended with '-thumb'. An 'img' tag is created for the main photo and stored in the 'Entry Body' field and another 'img' tag is created for the thumbnail photo and stored in the 'Extended Entry' field.

Options

The above is enough for you to produce well designed galleries and albums. If you want, you can stop here, but there are several areas of the system that can be customized.

Weblog Description

Enter something here if you want a custom Description for you web gallery to appear on the main Gallery Index page. Otherwise, a general description and a link back to the template developer will appear.

Gallery title images

By default, Photo Gallery uses the last image uploaded into a album for the title image for that album. That appears as a thumbnail on the main index and full size on the main album page. If that's not what you'd want, you can customize this behavior in two ways.

  1. Choose an image You can designate a particular image from the album to be used as the title image. To do so, add the following text to the 'Category Description' field in the category setup page:

    titleimgid=[entry ID]

    The 'Entry ID' is the numerical entry ID of the entry for the image you want to use as the title image. (There are several other things that can be done with text placed in the 'Category Description' field including custom CSS for individual albums and hiding albums. See the Stop Design page for more information.)
  2. Create a Custom Image If you'd like, you can create a custom image to use instead of one of the album images. To see what this looks like, see this sample Gallery Index and this sample Gallery Title page. This is a fair bit more complicated, so pay attention.

    To use custom images, you'll need to create 2 image files for each album, with the following sizes:

    • Gallery Index - 220 x 69
    • Gallery Title - 733 x 334

    Save the larger, Gallery Title image as 'title_img.gif' and the smaller, Gallery Index images as 'title_img_sm.gif' and place them in a subdirectory of the directory of the directory where the Gallery Title, page is published for that album.

    Lastly, change the 'auto' to 'manual' in the path in the 'Link to File' fields for the Gallery Index and Gallery Archive Index templates as well as the Gallery Title archive template. For example, on the Gallery Title archive template, the linked filename would change from 't_gallerytitle_auto.php' to 't_gallerytitle_manual.php'.

Favorites

Photo Gallery has built in support for favorites. Any image in any of your albums can be added to a special 'Favorites' album. Simply create a new MT category named 'Favorites' and assign it as a secondary category to your favorite images. The 'Favorites' category should not be used a a primary category. Note that when you look at an image through the favorites album, the 'next' and 'previous' links refer to the images in the photo's main album rather than the favorites list.

How to have a photo in more than one album.

Oh yeah, I almost forgot. So how do you have a photo in more than one album and have next and previous link work right in the individual pages? Well, one way would to simply upload the photo twice, once in each album. That's the easy way. But that means the photo exists twice on your server and, if you ever decide to edit it (to remove redeye you missed or what ever), you'd have to remember that it was there twice and make sure both copies got replaced.

There is a better way, although it's a bit more work. Upload the photo once into one of the categories. Photo Gallery creates the image files and links and everything. Since each photo is it's own entry, you can find and open it in the entries list. You can create a duplicate entry, with the second album as primary. Just open a new entry window and copy each field from the original exactly as is. I find this works best with side by side tabs or browser windows. Once you have an exact copy, except for the album (category), save the entry. Now you have a new entry for the second album that points to the same images as the original. You shouldn't do this with the favorites, however, as it is a special album designed to be secondary.

FAQ & Troubleshooting

I keep getting a 500 server error, what's wrong?

Two possible reasons.

First, double check to make sure the permissions on gallery.cgi are set to 755.

Second, if you permissions are correct, you may have already have installed a plugin that comes prepackaged with Photo Gallery. You can check in two places. One, check for duplicates in the main plug in list for your Movable Type installation. If you find any, disable one of the duplicates. It doesn't matter which one. If you don't see duplicates there, check your web server error logs You should be able to identify which plugin is in conflict, and than you can go back and remove one of them.

Thumbnails are not appearing for me, what is wrong?

The likelihood is that you do not have PerlMagick on your server. The requirements for PhotoGallery show that it needs the ImageMagick module, but it also needs PerlMagic as well. What's PerlMagick? This is straight from the PerlMagick page:

PerlMagick is an objected-oriented Perl interface to ImageMagick. You must have ImageMagick 6.2.0 or above and Perl version 5.005_02 or greater installed on your system for either of these utilities to work.

Usually, if ImageMagick is there, PerlMagick is too. It's pretty easy to check for ImageMagick, either by you checking your server or automatically when installing Photo gallery through Plugin Manager. Checking for PerlMagick is much harder, so we just assume it's there if ImageMagick is there.

The bottom line is, check with your host to be sure that PerlMagick as well as ImageMagick are installed on your server.

I already have an older version of Photo Gallery installed. How do I upgrade?

If you're using Plugin Manager, upgrades are accomplished simply by clicking the "Find Updates" button. If a newer version is found, then an "Upgrade" button will magically appear. They click that button and the rest is automatic.

If for some reason you are not using Plugin Manager, simply download the newer version and install it like you would a new install, overwriting any files with the newer ones.

Comments

Is possible use photo gallery in mT 4.1??? Thanks

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About Majordojo

"Majordojo" is the name under which Byrne Reese releases the software he writes. Byrne Reese is a father, a product engineer, an open source hacker and an employee of Six Apart.

 Subscribe to this site's feed

View Byrne Reese's profile on LinkedIn

Recent Comments