hi all,

i tried to create an image which has to be as link ....but i faced a problem which is ..no thing appears ...if any suggestions ..i'll be more than greatful..

$img_path = ("/sites/all/modules/request/edit.png");
    $link_text = theme_image("$img_path");
	$form['request'][]=array(     
  '#value' => l($link_text,'http://localhost/drupal?q=request/form&'.'vid/'.$obj->id, array(), drupal_get_destination(), NULL, NULL, FALSE, TRUE),
	
	);

Comments

amira’s picture

any suggestions there....!!!!!!!!!!

grendzy’s picture

It looks to me like you're passing l() one too many parameters.

See http://api.drupal.org/api/function/l

amira’s picture

thanks grendzy for ur concern,
i changed it to :

 $img_path = ("/sites/all/modules/request/edit.png");
 $link_text = theme_image("$img_path");
 $form['request'][]=array(     
  '#value' => l($link_text,'http://localhost/drupal?q=request/edit&'.'vid/'.$obj->id, array()),
	
	);

but still the image doesn't appear.

sahuni’s picture

Hello,
I don't understand well your code (beginner), but to show an image as a link :

$link = l($img, $path, array('html' => TRUE));
with $img = theme_image($pathImg, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE);
Does it help?

amira’s picture

hi sahuni,
actually iam a newbie in drupal.....:$:$

i tried what u recomended and here is what i did.

 $img = theme_image("/sites/all/modules/request/edit.png");
$form['request'][]=array(     
  '#value' => l($img,'http://localhost/drupal?q=request/edit&'.'vid/'.$obj->id, array('html' => TRUE)),
	);

and again again it doesn't appear.

sahuni’s picture

normally images show in your site? .png image?
Your image is really where you think it is?
can you just create a module which shows an image (without link), so you see if problem is in your link or elsewhere.

amira’s picture

i tried this

$img_path = ("/sites/all/modules/request/edit.png");
 $img = theme_image("/sites/all/modules/request/edit.png");
 $form['request'][]=array(     
   '#value' => $img,
	);

nothing apears :'(