Drupal could not display image problem - answer with input format

We could build excellent website using only text and image, these two elements is the essential basic block for most of the website.

It is not difficult to have drupal setup for accepting text and image at all, FCKEDIT module and IMCE module make an excellent couple for writing articles online with the ability to insert both text and image.

Unfortunetly, after writing your first article with both text and image content, the webpage does not display any image at all!

What is the problems?

The problem is related with the drupal 's input format concept. which is an very important concept for drupal, It is not tiny thing that novice could select to neglect, cause you might not able to display your image after inserting image into the content.

Input Format is made up of several filters. Drupal 's filter is a machanism to transform the input text in a predefined way. here 's drupal 's official definition for input format:

"Input formats define a way of processing user-supplied text in Drupal. Each input format uses filters to manipulate text, and most input formats apply several different filters to text, in a specific order. Each filter is designed to accomplish a specific purpose, and generally either removes elements from or adds elements to text before it is displayed. Users can choose between the available input formats when submitting content."

One of the most important functionality of filter is to filter out malicious scripts for security reason, That is why drupal 's default installation use 'Filtered HTML' as the default input filter. All of your article content will be filterd before displaying to end user. The default 'Filter HTML' filter is very strict, It only allow few HTML elements to pass, the html image tag '< i m g >', will be removed by default, and that 's why our image do not display on the webpage.

input format 1-2_f

To display image, just go to 'Site configuration->input format' to add tag '< i m g >' to the allowed list.

The widely used input format

After the installation , drupal comes with two input format

input format 1-1_f

Another useful input format , the 'php input form' allow us write php code directly in the content and will display the result of php code execution, we have to enable it at 'Site building->Modules' in order to use it! But be aware it is very dangerous to allow user to use 'php input format'!

Recommended books: 
Image of Using Drupal
Manufacturer: O'Reilly Media, Inc.
Part Number:
Price: $45.00