Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By gdhia on
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
Views or tpl.php
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>