Reply to comment

How to use images in Drupal 6

One of the first things you encounter when setting up a Drupal site is how to add images. Of course every site needs images, but Drupal's native image support is not so great. It requires hand coding image URLs into your content, which if you're a web designer isn't so difficult, but for anyone else using your site is a real pain.
 
There are lots of solutions available, 3 main ones, and 2 that I like and use.
 
The 3 main solutions are:

  1. Image
  2. ImageField
  3. WYSIWYG solutions (TinyMCE or FCKEditor with IMCE)

 
Image module is the one I don't tend to use. This is historically the most common module for images, and according to Drupal statistics at http://www.drupal.org/project/usage, it still is.
 
Image and ImageField fulfill very similar tasks, but go about it in fundamentally different ways. The primary difference is ImageField is a field, and image is a node. Or, ImageField attaches an image to a piece of content, whereas Image is a piece of content. Both approaches can yield similar or even the same results, but it's a logical distinction that is quite important when it comes to displaying your content.
 
So if you're deciding which one to use, ask yourself "does my image make sense entirely on it's own?" ..if yes, then Image module may be appropriate. This could occasionally be true for Image Galleries, or Flickr type pages. In most cases though, you're showing images of something.. weather it be of a user, a product, an event.. in any of these cases there is lots of information and you just happen to be attaching pictures to that piece of content. This is where you need ImageField.
 
ImageField also can be used with ImageCache, which is an absolutely amazing module for resizing images along with other things. This is a huge plus point for using ImageField whenever possible.
 
ImageField does not always meet the need though. Specifically, if your user has to be able to place an image anywhere in their content (such as when writing a blog post, or an informative article requiring a number of pictures), then you need a more flexible solution. For this, a WYSIWYG editor such as TinyMCE is perfect. The IMCE module adds an image upload button to the insert image icon in your editor, so it's just a few clicks and you can upload an image from your computer that can then be moved around the post any way you like, floated to the left or right, or whatever you like. For many things, this solution is perfect.
 
So in summary, ImageField combined with Views is perfect for when images should always show in the same place. TinyMCE with IMCE is great when your users should be able to put images anywhere in their content that they like.
 
So make that call, download the modules, and dive in!
 
 

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options