Hello,

I am Trying to build a publications library on drupal 7.
So, I created a new content type : "publications" with fields:

  • Title of the documet
  • publication date
  • cover image : (field type: Image)
  • pdf file : (field type: File)
  • tags
  • description
  • author

I'am trying to get the cover image set as link to the pdf file.
Does any one know how to get this working ?

Thanks in advance.

Comments

spovlot’s picture

There are a few ways to do this. One option would be to use Views and the Rewrite Results function under field settings to link to another field.

The other option is to customize your node--publications.tpl.php with something like:

<a href="<?php print $content['field_pdf'][0]['filepath']; ?>" ><?php print render($content['field_image']); ?></a>