Closed (works as designed)
Project:
PDF to ImageField
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2011 at 10:21 UTC
Updated:
3 Sep 2014 at 15:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joel_guesclin commentedBizarrely, the module doesn't seem to do this automatically. I intend to post this as an enhancement request. In the meantime, there is one easy solution which is to use the Contemplate (Content Template) module. This allows you to rewrite the output. I had a very simple case with nothing but body text, the PDF file field, and the Image file field. So first you configure both fields to output the URL (ie one will output the URL of the PDF file, the other the URL of the image file), and then you create a content template like this:
Of course the names of the CCK fields will probably be different in your case.
Comment #2
iantresman commentedThis would be an obvious, and desirable feature. I just went into the image settings, and found that I could insert all kinds of links (generated via ImageCache) to other image sizes, but the one obvious omission, was a link to the original PDF!
Comment #3
dman commentedSomething like his was added to the d7 2.x branch, but only by radically replacing the way that file fields was working, so that method was unsustainable.
If someone wants to have a try, we can look at a patch. But bear in mind, there is no intrinsic link between the file and the image saved in the database, they are just two attachments that happen to be on the same node. thus, when the time comes to render the image using the field renderer, it doesn't have a handle on the PDF file that you are looking for. It would be interesting to see if someone knows how to solve that from within the CCK field rendering API.
Comment #4
iantresman commentedAnother workaround to joel_guesclin's post #1, I guess, would be to use Views, and to rewrite the field. But yes, it would be more elegant to have it incorporated into CCK. Perhaps a post in the CCK issues forum might bring forth some suggestions.
Comment #5
joel_guesclin commentedI agree, and I actually used the Views solution elsewhere on the site
Comment #6
joel_guesclin commentedAccording to this related post, getting this into the module is horrendously difficult, so despite it being less "clean" probably the best thing to do (or at any rate the easiest) is to create an override template for the node (in my case for example, this is a file called node-issue.tpl.php), which contains some code something like this:
Comment #7
dman commentedpushing to current dev as a feature request, still want to see this happen.
Comment #8
Alexxikon commentedI am not sure if the Image link to file module that I wrote could be useful to solve this problem, but it's worth giving it a try. The module allows you to automatically link any image field in a node to any file field (e.g. a PDF file) in the same node.
Comment #9
dman commentedI tried out image_link_to_file and it works just great. I fully endorse that as a working solution for use with this module. It's so easy to configure, it's silly.
I think it's better that that generic solution gets plugged onto this one, rather than this one trying to get too far into rendering settings etc. These are complementary.
Linked Field
Also does exactly this, and I love field_formatter_settings power even more than image_link_to_file simplicity, so *that* is a more flexible and fun way to do exactly this also.
