Block with <img> not working, help!

Cayhn - December 4, 2008 - 14:55

Hello!
I have created a new block that I want to show on ALL pages. In this block I have the following code:

<a href='#'><img src='misc/headerjl.png'></a><a href='#'><img src='misc/headerpb.png'></a>

Now here is the problem, the block will show just fine on the frontpage /node. But it wont show up in any other place on the whole website. I have configured the block to show on all pages and visible for all users logged in or not. The block will show just fine on ALL pages if I remove the IMG tags and only have links. I use Full HTML formatting so img tags should be allowed...

Anyone have an idea?

Relative paths

add1sun - December 4, 2008 - 15:52

Your images are using relative paths which mean that works fine on the home page where misc/headerjl.png reads as http://mysite.com/misc/headerjl.png but when you go to another page, say node/2, that img path becomes http://mysite.com/node/2/misc/headerjl.png, which is not where the image is, hence it doesn't display. You need to use an absolute path like src="/misc/headerjl.png".

Lullabot loves you
--------------------------------------
Join us at Do It With Drupal!
A large scale, curated education event
December 10-12, New Orleans

Thank you for your answer.

Cayhn - December 5, 2008 - 09:46

There was something wrong with the linking. /misc/headerjl.png didnt work better so instead I had to add http://www.sitename.com/misc/headerjl.png
That worked, why is it so?

 
 

Drupal is a registered trademark of Dries Buytaert.