user434885 user434885 - 6 months ago 9
HTML Question

drupal img tags not being displayed with clean urls

So im using drupal to set up a simple web project. I was using img tags to display a few images.
simple img tags like

<img src="images/home.jpg" />


everything was working fine until i switched on clean urls and suddenly all the images disappeared. They still appear in the page source code just dont display.
How do i fix this ?

Answer

Try using theme_image instead. For example:

print theme_image("images/home.jpg","My Alternate Text","My Title Text");

Alternatively, if you are putting these images inside the body of a node, and you don't want to use PHP, then you need to get Drupal's 'base path' on the front of your image source.

For example, change your image source to '/images/home.jpg' and that should work (if the images directory is inside your base www directory).