Is there a module that allows the user to add image and at the same time add link to the image?

Comments

jjweiner’s picture

If you are implementing this from within a module (programatically), you can use the Drupal's link function to use an image as a link.

for example:

<?php
	l('<img src="/path_to_your_image/your_image.png" />', 
        'path_to_your_page/page/', 
		$attributes = array('class' => 'your_css_class'), 
		NULL, 
		NULL,
		$absolute = FALSE, 
		$html = true);

?>

The API page for this is at:
http://api.drupal.org/api/function/l/5

boogieland’s picture

Thanks. Is there a way to make an add field for this type. I already had a Link Field and Image Field. Can we join them together like Image and URL as one field? So that I will only upload the image and input the URL.