Attaching images to other nodes

The Image Attach module allows you to attach images to any kind of node. You can use existing image nodes or upload a new image, which will automatically create a new image node. The Image Attach module is part of the Image module package.

To use the image attach module:

  1. Enable the Image module and the Image Attach module
  2. Make sure attachment of existing images to nodes is enabled at admin/settings/image/image_attach (this is the default)
  3. Go to admin/content/types to administer content types. For each content type for which you want to enable attachment of images, click "edit" (or click on the content type name) and set the option for "Attach images" to Enable.
  4. Optionally, while on this page, you may set the derivative size to show for both teasers and full nodes, and also limit the maximum number of image nodes that may be attached to each node.

The image is displayed as a thumbnail, linked to the image node, in the top righthand corner of the node by default. This can be controlled to a minor degree by changing the "Attached image ... weight" on the content type's admin page (see above), and to a more major degree using theming and custom CSS.

Alternatives to Image Attach

Adding modules and themes

"Do I need all these extras?"

Each module requires memory to run on your site

Before installing extra modules, you should consider the required functionality for your site, and only add a module if your site really needs it. Unnecessary modules consume memory and other resource needs of your site, and will make pages load slower. Because a module is popular or someone tells you that "every site needs it" doesn't mean that yours does. There are good sites that have been built with absolutely no contributed modules at all.

Also, you should focus on content, functionality, and configuration of your site before you consider how it should look (the theme), since that decision can be made later and may detract from your thinking about functionality and content.

Be selective

Themes are largely a matter of taste. For example, many people do not like to use a "fixed width" theme, but lots of people do. One nice thing about themes is that they are mostly independent of your content so you can switch them when you want. Caution, though, there are parts of your site (blocks, for example) that get built based on the theme, so switching themes can leave junk lying around to slow down your site.

Now, if you experiment with different themes and modules, you should also look at the Update Status page in the administration section and the Site Documentation module to make sure the modules are up-to-date and your site is clean.

Setting up cron

More complete information can be found on the main cron page. If you can understand that page, then use it first.


Cron is an extremely important resource to your Drupal website setup. Many modules, including major system modules, utilize cron's power to do their jobs properly. Practically speaking, cron will alert you to security and other updates necessary to your site, provide a list of broken links and pages on your site, and perform other scheduled tasks (like back-ups).

Using IMG tags with image module

A common question is how to display images. In addition to other modules such as img_assist, you can also use img tag.

With clean URLs

<img src="http://www.example.org/image/view/##/preview" />
<img src="http://www.example.org/image/view/##/thumbnail" />

Without clean URLs

<img src="http://www.example.org/?q=image/view/##/preview" />
<img src="http://www.example.org/?q=image/view/##/thumbnail" />

If you go to admin >> settings >> image and look at the sizes, you will see a default name, preview and thumbnail. You can add and label other sizes as you choose.

If you want to link to your original image, the syntax is the same with the tag of _original.
With clean URLs

<img src="http://www.example.org/image/view/##/_original" />

without

<img src="http://www.example.org/?q=image/view/##/_original" />

With clean URLs it is possible to use relative paths for the image URL. For example:

<img src="/image/view/##/_original" />

So, to break it down, sitename / image / view / image ID# / label will get you to an image suitable for use in an <img src=""> tag. If you add additional sizes to the your image module settings, you can link to them by their label names as well.

Pages

Subscribe with RSS Subscribe to RSS - Needs copy/style review