473,394 Members | 1,840 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,394 software developers and data experts.

Image links in PHP (Drupal)

3
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 10459
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.

Regards
Dheeraj Joshi
Dec 31 '09 #2
neu7o
3
in general do you happen to know the syntax if someone needs to create an imagelink with PHP.
Dec 31 '09 #3
Atli
5,058 Expert 4TB
@neu7o
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";
  5.  
  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. ?>
  15.  
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
neu7o
3
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:
file:///Users/UserName/Sites/ProjectNameFolder/images/filename.jpg
Jan 22 '10 #5

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

Similar topics

9
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...
16
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: ...
1
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...
7
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...
7
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...
0
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....
6
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...
5
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. ...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.