I have a set of post/articles where I need to add a constant image (get offers!) but I need to customize the link for each post. So, in short, is an image that is constant in each post but with a unique link to each post/article. Any suggestions on how can I got about doing this?

found this but does not work for v.6:

http://drupal.org/project/linkimagefield

Thanks!

Comments

alim418’s picture

You can create an admin settings page for your module. use system_settings_form()
and on your template.php inside _phptemplate_variables(), add a variable for node.tpl to use that contains that image.

<?php
  $vars['post_image'] = variable_get('post_image', '');
?>
and in your node.tpl.php will be able to access $post_image, from there you can do <a href="node/<?=$node->nid;?>/someplace'><img src='<?php print $post_image;?>' /></a>