Seems simple, but it's driving me nuts. Does anyone know how to display image links in the footer & block regions of Drupal?
Image links in PHP (Drupal)
Collapse
X
-
I don't think without looking at the code anybody can help you.
So please post the relevant code which you think is creating problem.
Regards
Dheeraj Joshi -
An image link. That would simply be an <img> tag wrapped in an <a> tag, right?
In plain PHP code, that might look something like:
[code=php]
<?php
$image_location = 'http://www.w3.org/2008/site/images/logo-w3c-mobile-lg.png';
$url_link = 'http://www.w3.org/';
$url_title = "Click here to visit the World Wide Web Consortium";
echo "<a href=\"{$url_li nk}\">
<img
style=\"border: none;\"
src=\"{$image_l ocation}\"
alt=\"{$url_tit le}\"
title=\"{$url_t itle}\"
>
</a>";
?>
[/code]
The style removes the blue border the browse automatically puts around the image. (I assume you don't want those)
Not sure how this fits into Drupal though. I haven't worked with that one much.Comment
-
Thanks Atli. Example works in Drupal.
Right now I'm just testing locally. I'm using MAMP and have setup my root folder to point to /Users/MyUserName/Sites/ProjectNameFold er/.
The path for "image_location " works if it's absolute (just like the example you gave) but if I put in a relative path it does not work (for example: /images/filename.jpg)
I also tried using this path:
file:///Users/UserName/Sites/ProjectNameFold er/images/filename.jpgComment
Comment