1

Actually, I have a content type with 2 fields, image field (multiple) which will contain some pictures and an attachment field (accept only one file) which is file of type PDF.

I have a view where I put my gallery and each picture opens in a colorbox. The PDF file (actually global pdf for all images) is only a button.

There was a change and the new requierement is: "For every image that goes up, must have its own PDF. Every image should have its own associated file."

Another requirement is, if the image is opened on a colorbox also appears a button (in the colorbox) which displays the PDF associated with the corresponding image.

Any idea??? Sorry for my bad english.

  • Can you explain your question little bit more..??? what is your actual requirement..??? do you want to link a pdf file to file field..?? – Abin Aug 3 '15 at 6:10
  • As per your question you said that you have multiple images field but file field is only one. Then how can every image can have its own associated file? please clear your concept. – WaQaR Ali Aug 3 '15 at 6:57
  • @Abin I update my question.. Better explained? – Dvex Aug 3 '15 at 14:34
  • @WaQaRAli I update my question.. Better explained? – Dvex Aug 3 '15 at 14:34
0

You can create and use https://www.drupal.org/project/field_collection to have a new field containing an image field and a file field for your pdf. You set the field in unlimited. Problem is that you might have to reupload every picture manually or write an update script that does the conversion for you.

Then for the colorbox popup with your button, have a look at https://www.drupal.org/project/entity_popup

  • Thanks your help. Field Collection worked perfect! I try to use entity popup in manage display for my collection field but I put, as a caption of image-colorbox, the URL file of my PDF. How to put this as a button? – Dvex Aug 3 '15 at 16:49
  • You can modify or create a custom template (.tpl) for your popup display and change the caption display to a button with the caption as URL – naitan Aug 10 '15 at 2:18
  • I am already using field_collection to accomplish this but still can't figure out how to get the image thumbnail to link to the PDF. I have an image field and a file field in the collection. – Christia Feb 14 '18 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.