New Podcast

Posted Tuesday, January 31 at 3:28 pm
  Thomas Turnbull (tom_o_t on drupal.org) and Alan Palazzolo (zzolo on drupal.org) join Mike Anello to talk about their new book from O’Reilly Media, Mapping with Drupal. Mike’s usual co-hosts, Andrew and Ryan, were both unable to participate in the podcast, leaving Thomas and Alan subject to Mike’s long-winded (but extremely interesting by some accounts) questions.
Download Podcast 73
DrupalEasy_ep73_20120131.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

The DrupalEasy workshop provided a balance between "Best Practices" for Drupal development and an elegant example of integrating content from Youtube , Flickr, etc. using the FeedAPI. The workshop provided useful insights in advanced site design and a wealth of resources to speed up development and make deployment safer.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

ImageField

If you need to add images to your content, then you probably want to be using ImageField. <140

O images, images - wherefore art thou image handling?

Not in the default install of Drupal core, that's for sure.

Along with a the lack of a native WYSIWYG editor, proper image handling support is one of the major complaints against Drupal (did I mention the steep learning curve?) Luckily, there's a robust and very (very) busy community of developers who spend an inordinate (and possibly unhealthy) amount of time writing excellent modules for Drupal - one of these is called ImageField.

ImageField brings to Drupal the ability to add images to content in a big way. It utilizes a standard "Browse" (or "Choose File") HTML widget to allow users to select images from their local machine for uploading to the web server when the page is submitted.

Consider the following senario: you're building a Drupal site that chronicles major playwrights throughout history. For each one, you have a bevy of images that you'd like to include as part of the each writer's page (a "node" of the playwright "content type" in Drupal-speak). For example, let's assume that you have the following images related to William Shakespeare:

  • 2 images of the man himself
  • 3 images of his boyhood home
  • 2 images of the Globe theater
  • 1 image of an old playbill from a production of Othello

In addition to associating each of the images with a single writer, you also need a malleable way to display the images, depending on the context. What's the best way to build an infrastructure to handle this? Easy. Use CCK, ImageCache, and ImageField. This noble trio of modules allows you to attach multiple images to each piece of content on your site then have the flexibility to display them to your end users in a variety of ways.

While CCK is the framework that allows you to add additional information to nodes (other than the default "text" and "body" fields) and ImageCache handles all the image manipulation (mainly resizing and cropping), ImageField takes care of getting the images from the hard drive of the person creating the content to your web server.

Going back to the Shakespeare example, perhaps the best way to accomodate the list of available photos is to set up 3 ImageField fields for your "playwright" content type: an ImageField for portriats, a second ImageField for biography-related images, and a third ImageField for miscelleanous images. Then, taking advantage of ImageField's ability to accept multiple images per field, you'd be able to upload Shakespeare's 2 portraits into the "portraits" ImageField, the 3 images of his home in Stratford-upon-Avon into the "biography" ImageField, and the remaining images into the "miscelleanous" ImageField.

Once the images are uploaded as part of a node, they are available just about everywhere the node is available including in views and standard node displays.

This module's dependence of the FileField module means that it inherits all of FileField's capabilities, including the ability to limit uploaded files by type and size. In addition, ImageField also allows site admins to limit uploaded images by resolution.

ImageField also provides an option for the content creator to add both a title and "alt" text entry for every uploaded image.

Unlike the Image module, images uploaded via ImageField do not become Drupal nodes on their own.

Stats

Syndicate content