473,385 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Image links in PHP (Drupal)

Seems simple, but it's driving me nuts. Does anyone know how to display image links in the footer & block regions of Drupal?
Dec 30 '09 #1
4 10445
Dheeraj Joshi
1,123 Expert 1GB
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.

Dheeraj Joshi
Dec 31 '09 #2
in general do you happen to know the syntax if someone needs to create an imagelink with PHP.
Dec 31 '09 #3
5,058 Expert 4TB
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:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $image_location = 'http://www.w3.org/2008/site/images/logo-w3c-mobile-lg.png';
  3. $url_link = 'http://www.w3.org/';
  4. $url_title = "Click here to visit the World Wide Web Consortium";
  6. echo "<a href=\"{$url_link}\">
  7.           <img
  8.             style=\"border: none;\"
  9.             src=\"{$image_location}\" 
  10.             alt=\"{$url_title}\"
  11.             title=\"{$url_title}\"
  12.           >
  13.       </a>";
  14. ?>
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.
Jan 17 '10 #4
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/ProjectNameFolder/.

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:
Jan 22 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Karl Burrows | last post by:
I am working on a Website for a non-profit group and for some reason I have one link that doesn't want to cooperate. All the image links work fine with the onmouseover and onmouseout script except...
by: Harry Putnam | last post by:
I keep stumbling around with varius alignment tags, even using STYLE tag with absolute positioning but not getting a simple job done. I have an arrangment like this: ...
by: fif3336 | last post by:
Hi everyone, I'm forwarding here a 100 euro bounty hunt I've started at drupal.org. It's about making a "word-html cleaner" module for the open source cms Drupal. All informations, including my...
by: fredo | last post by:
I've studied Eric Meyer's pure css popups, version two: http://meyerweb.com/eric/css/edge/popups/demo2.html which pops up an image when I roll over a text link. Now I want to pop up a large...
by: Cate Archer | last post by:
I want to have a border around an image that changes color when the mouse hovers over it. The following code works perfectly in FireFox but not in Internet Exploiter. The text link changes color...
by: Iain | last post by:
Hi I am using Borland Developer 2006, C# web application. Fairly new to the .net platform and very new to repeaters. I have 2 repeaters on a page, both of which are filled from a database....
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since...
by: Roy Smith | last post by:
Be kind to me, I'm a CSS newbie... I've been playing with drupal, building a web site (hyc-test.org). I started with the "sky" theme, but didn't like the way it rendered list items in menus. ...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.