Images in Posts in Drupal Tutorial
This guide walks the reader through the steps of configuring a Drupal installation to allow Drupal users not only have images displayed within posts but also to configure the position and size of the images.
First download all the required modules to your webserver, these modules are:
-
Image module
-
Image Assist module
-
Views module
Untar all three tar.gz files, and move the resulting directories into drupal_install/sites/all/modules
with drupal_install
being the path to your drupal installation. While you are logged into your server, if you do not already have the ImageMagick (or corresponding package) installed, you probably should do so now, as this will allow you resize images automatically. After you move the modules (or install ImageMagick) the command line work is over.
Navigate to your Drupal site from your web browser and then log in as administrator. Then go to Administer >> Site Building >> Modules. Make sure that the following modules are Enabled.
-
Upload
-
Image
-
Image Attach
-
ImageMagick Adavanced Options
-
Views
-
Views UI
Now go to Administer >> Site configuration >> Input formats.
On any of the input methods here that you wish to be able to use images in, select the configure link, and then check the Inline images box and save configuration. Each input method that you want to enable inline images for must be done individually.
Next go to Administer >> Site configuration >> Image assist.
The settings here are up to the user, dealing with the basic configuration of how the images will appear (such as sizes, previews, thumbnails, the like).
Go to Administer >> Content management >> Content types and on each content type you want to have image enabled for select edit, then within that page select Image Attach settings and ensure that it is enabled.
Finally go to Administer >> Site configuration >> Image toolkit. Make sure that the ImageMagick Toolkit (that was installed earlier) is selected.
The configuration of Drupal for inline images should now be complete.
The rest of the article will deal with inserting an image with this setup.
Open one of the inline image enabled content types up to edit, or create a new one.
Once you have the picture you want to insert, go to Attached images, and hit the “Browse. . .” button to find and select that picture. Rename it if you wish, then hit the “Attach” button. Scroll back down to the Attached images section, and select the none option within the box, rather than the image you just uploaded (otherwise it will stick a thumbnail of the image at the bottom of your post).
To add the image to your post, click on the Add Image button below the main text box.
Select your image from the page that is presented by clicking it, then go through the settings to configure it as best suits you. Once finished, click insert, and it will insert the appropriate tag at the location of your cursor in the text box, and once you preview/save the content the picture will appear at the location.