0

I hope the title is a bit clear but this waht I need/want: At the moment users that have the right to make content can add a PDF for certain content types, this is added as an attachment so users have to go to the content first and then have to click on the PDF to see it. Is it possible to let my users add only a PDf to a content type and that the content type IS a pdf only? So when someone goes to that page and clicks the link the PDF is immediately shown instead of a page in between with an attachment. So this makes it 1 click to see the PDF and not 2.

  • In Drupal nodes are nodes, period. It is possible to emulate what you want, but I don't think there is a module for that, and it would require a lot of coding. You could make a content type with only PDF field, and then use hooks to initiate download. But I will not code it for you ;) If you will start coding it and have problems, I'll gladly try to answer. – Mołot Feb 3 '14 at 8:20
  • drupal.stackexchange.com/questions/2526/… might be a good start if you wanted to just have it displayed inside the page instead of just the link; otherwise, I'd look into drupal_goto() and the filename associated with that field. – Jimajamma Feb 3 '14 at 8:59
  • 1
    If the node is just a pdf and nothing else why not use a file entity instead? See drupal.org/project/file_entity or just plain drupal files without the file entity module? Also, it is possible to link directly to the file instead of just linking to the node the file is attached to, which may or may not be suitable depending on your use case. – rooby Feb 3 '14 at 9:21
  • Thank you guys! File_entity seems to be the thing I need! – user1541645 Feb 3 '14 at 10:08
0

This doesn't exactly answer your question (since maybe there is a module for that, but not that I'm aware), but here is what I do.

I have a content type for documents with two fields: summary/abstract and then a file upload field that accepts PDFs. If a PDF has a summary or abstract, I put the summary/abstract in that field and just link to the content's page figuring that the user can read that and then click on the document if they want. Otherwise, I still use this document content type to upload the file, leave the summary blank, and then link directly to the uploaded file itself. It would still have its own page created by the content type, but a site user isn't going to see that.

| improve this answer | |

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.