Drup

Page 261

Photo Uploads Image handling in Drupal has long been a distributed effort between several cooperating (or competing) modules. The Image module (http://drupal.org/project/image) was the universal solution in Drupal 4.6 and 4.7, but with the advent of CCK, several new modules appeared that leveraged this new, more flexible system. Because the Drupal community’s development trends are headed toward websites built around CCK and Views, we’re going to build our site around this newer approach, building on the basic functionality of CCK and Views. ImageField (http://drupal.org/project/imagefield) is a module that provides a reusable image upload field to CCK, which we’ll be able to use to upload our photos.

Thumbnail Generation Despite its name, the ImageCache module (http://drupal.org/project/imagecache) does much more than simply cache images. It is often paired with ImageField, because although ImageField handles the upload and storage of images, it does not provide any way of creating thumbnails. ImageCache can not only create thumbnails, but also chain together several image manipulations such as crop, rotate, scale, desaturate, and sharpen to create completely customized displays of images.

Photo Galleries The display of images in a gallery can be made from a few pages created by the Views module. Because ImageCache and ImageField provide Views integration, you’ll be able to select any desired images created with ImageField, and then ImageCache will scale those images down for display in the view.

Spotlight: ImageField Building on the flexibility of CCK, any module in Drupal can provide a reusable field that can be used to extend your content types. Fields that handle things like text or numbers are bundled with CCK, but you can just as easily add fields that allow you to upload audio and video files, click web links, and more. These other field types are separate projects on the Drupal.org website, available under the “CCK” category (http: //drupal.org/project/Modules/category/88). The ImageField Module, available from http://drupal.org/project/imagefield, is one such specialty field that provides a reusable field for image handling, as shown in Figure 7-2. Like other CCK fields, you can configure an image field to allow multiple values, so any number of images can be uploaded to a single node. You can even add multiple fields to a single content type, in case a piece of content has the need for multiple images, each with specialty uses.

Spotlight: ImageField | 237


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.