Home > Drupal > How to create a image link in drupal using l() function

How to create a image link in drupal using l() function

this snippet enables you to create a image link

<?php
$src = path_to_theme().'/images/images.jpg';
<?php print l('', 'LINK-TO-PAGE', array('attributes' => array('class' => 'anchor-class'), 'html' => TRUE));
?>

notice there are 3 parameters: l(1st_param,2nd_param,3rd_param);

1st_param: the html image
2nd_param: the url/path
3rd_param: we add class in our anchor tag and enable html to TRUE

Hope this helps you guys!

http://www.arnelbornales.site90.net/blog

About these ads
Categories: Drupal Tags:
  1. January 10, 2010 at 11:27 pm

    Super-Duper site! I am loving it!! Will come back again – taking your feeds too now, Thanks.

    I’m Out! :)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: