By baldy on
Hi,
I am busy rewriting a module for drupal 5. When I first wrote the module I hard coded the <a href> elements with the image inside them, as I could not pass <img> elements to l().
I have read up on the forums and some people suggest using css but this seems more suited to menus than the gallery I am working with.
What I am trying to do is something like this l("<img src="$imgurl">","node/view/$node->nid") all this does is give me a link with the text and not the image.
Regards
Laurence
Cape Town, South Africa
Comments
$html param
From http://api.drupal.org/api/5/function/l :
If you set the last argument to TRUE, your link text will not be escaped and the image should show up.
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
image inside l() solved
Hi,
Thanks thats exactly what I needed. Here is my final code :
Regards
Laurence
argument position
Would be more useful moving the argument $html bool just after url argument, to avoid needing of inserting of null arguments?
___________
by Tassoman
geek, net addicted user
Just to note, all themes
Just to note, all themes should be ran through this function:
This allows any customizations in your template theme file to make their changes accordingly.
-Craig Jackson
-Web Developer
Thanks!
You've helped me to solve that problem ))) thanks!
I'm having a very simillar
I'm having a very simillar problem trying to change a text "delete" link being printed with views into an image. I've located the code responsible for the output of the link-
and I changed it to:
Still nothing. I've also tried a number of other code fixes, all with the same result. Nothing being outputted at all.
What am I doing wrong?
Jon.
For Drupal 6, this became
For Drupal 6, this became something like:
The 'array('html'=>TRUE)'
The 'array('html'=>TRUE)' part of this worked for me! So my code, with an ubercart thumbnail, looks like:
Thanks so much!
I also had similar problem
I also had similar problem and solved it using the CSS approach, which is achieved by adding a background image and then offsetting the text so that it is not visible (http://xavisys.com/css-trick-turning-a-background-image-into-a-clickable...).
I know this isn't the coding approach you were looking for, but it works and is very easy to implemented.