Page 1 of 3

[CLOSED]Downloadable PDF in News article

Posted: Sat Nov 09, 2013 6:05 pm
by jakovbak
Hello everyone!
I'm using News module for most of the pages on a client's site and now they want to add a downloadable PDF for some of the News articles. I've tried with Custom Field but it gives a full PDF page. I'd like to have only a PDF thumbnail in News Summary (and also in News Detail) and if user clicks on that thumbnail the full PDF document should be opened in new window or tab. Or just right-click to download...
Is there a way to achieve such thing with News Module? Or maybe in integration with some other module(s)?
Thank you in advance for your tips and suggestions and have a nice weekend!
Jakovbak

Re: Downloadable PDF in News article

Posted: Sat Nov 09, 2013 7:11 pm
by staartmees
Upload the pdf to uploads/pdf
upload the thumbnail to uploads/images/pdf
insert the thumbnail as an image
link the thumbnail to the pdf and set target to _blank

Re: Downloadable PDF in News article

Posted: Sat Nov 09, 2013 8:03 pm
by jakovbak
Hello staartmees!
Tnx for fast reply! It will work just fine, at least at the beginning... :-)
While "we are here", let me ask you one more thing (it just crossed my mind): What if they want me to place a lots of articles with PDFs all at once? They usually edit articles on their own because they are very basic articles but any manual HTML linking would be too much for them so I'll be the one to take care of that kind of articles. But in case they came up with dozens of articles, is there a way to connect thumbs and PDFs dinamically so the links are created on-the-fly? I'm not good (well, lousy is much better word!) in coding and it would be much safer option then manual linking. I don't care too much for the time spent on manual linking but I'm afraid of human error... And after 20-30 manual links, they all start to look the same. :-) Especially when PDF names are almost identical (variations like "rule155extended14-013.pdf", "rule155extended17-013.pdf", etc...)
Imagine what a mess it could become if I skip only one or two... :-P
If you have some idea or some resource where I can take a look I'll be grateful!
Thanks again and best regards!
Jakovbak

Re: Downloadable PDF in News article

Posted: Sat Nov 09, 2013 8:14 pm
by staartmees
Coding is't my thing either. In your case I would put each pdf or groupe of pdf-files with its thumbnail(s) in a submap in uploads/pdf.

Re: Downloadable PDF in News article

Posted: Sat Nov 09, 2013 8:55 pm
by jakovbak
Yes, that'll do! Another good starting point. Nevertheless, I'll keep this topic open for awhile if someone comes up with dynamic solution. Just in case...
Have a nice rest of the weekend!
Regards,
Jakovbak

Re: Downloadable PDF in News article

Posted: Sun Nov 10, 2013 2:47 pm
by uniqu3
Or you can try following this Tutorial http://www.i-do-this.com/blog/84/Conver ... -Thumbnail if you get stuck you can still contact Article Author for a contract work i guess.

Re: Downloadable PDF in News article

Posted: Sun Nov 10, 2013 4:33 pm
by jakovbak
Hello uniqu3!
I have seen this article but had no clue how to make it work with News module... I have tried thou, but as I said, coding thing... :-D
Thanks for the tip anyway!
Regards,
Jakovbak

Re: Downloadable PDF in News article

Posted: Sun Nov 10, 2013 5:42 pm
by velden
What do you main with 'thumbnail'? An small version of the actual document's first page? Or just an recognizable PDF icon?
The latter would of course be very easy to implement.

About the 'lots of articles': have a look at http://dev.cmsmadesimple.org/projects/file_listing

Maybe that's what you're looking for. However, it is not related to News module.

If your using News module only to link to pdf files, you might have a look at ListitExtended module: http://dev.cmsmadesimple.org/projects/listit2

There even exists a commercial add-on (for ListitExtended) allowing you to upload multiple files that connect to one item/article (very nice feature).

Re: Downloadable PDF in News article

Posted: Sun Nov 10, 2013 7:15 pm
by jakovbak
Hello velden!
A simple pdf-icon would do just fine. Documents are boring anyway, rules and propositions, that sort of things...
I'll check Listit and all the other links you've provided and see if the managing of pdfs would be easier than previous solutions.
As I said, I don't know right now how many pdfs will arrive and right now I'm just being cautious in case of an "avalange"... :-)
I'll be back with results in a day or two.
Till then, best and rainy regards!
Jakovbak

Re: Downloadable PDF in News article

Posted: Mon Nov 11, 2013 1:54 pm
by jakovbak
Hello everyone!
I've been exploring your suggestions but even if I see the potential, I don't know how to get there... Like ListIt2 for example. I've seen the help files, I've searched our forum, I've seen the video on "How to write LI2 custom field definition", etc... The only thing I was sure of, after all that reading and watching was - I don't know jack! So I've decided to play around a little bit with the things I understand. Which means I have improvised a bit... :-D
But I have also decided to share it with you no matter how stupid I may look afterwards... There is just one detail left unsolved to make this solution very simple, clean and user (read: editor) friendly and that's where some of you could help me out.

Let me start from the beginning...
There are two types of articles on this site: First, the one with image and text and second, the one with text and PDF for download.
I have created two custom fields - "image" and "pdfdownload". The second field is "text area type". Editor must place "pdf.png" icon in that field (from "uploads" folder) and link it with some PDF document (from "uploads/pdf" folder).
Now, it is quite simple and straightforward but I'm a designer and I want to make things a little more interesting or more pretty or... complicated? :-P
Let's say, I want this pdf icon to change on hover but if I try to explain how to do it to my editors, chances of me ending up dead are pretty solid!

So, my question is:
Is it possible to add this pdf.png icon as a pre-defined content for this specific field? Like, if editor goes to "Add article", there is "pdfdownload" field at the bottom of the page and there is that icon already placed in TinyMCE text area... Then, the only thing the editor has to do is to click on the icon, click on the link tool and choose the PDF document at his wish and - that's it! Styling of the icon could (should?) be done via css anyway so the editor really have to put the minimal effort to publish his article the way it was planned.

If this can't be done or if the solution would be too complicated - ok then... My icon in the front end won't have hover effect. If that's the worst that could happen, it's ok with me. But I believe this could be nice and simple feature to be used in various modules and situations, so maybe it's worth to try... Unfortunately, this is as far as I can go. Maybe some of you...?
Have fun in make fun of me and best regards! :-D
Jakovbak

Re: Downloadable PDF in News article

Posted: Mon Nov 11, 2013 2:15 pm
by Jo Morg
jakovbak wrote:So, my question is:Is it possible to add this pdf.png icon as a pre-defined content for this specific field?
Err... and why not a check box? So in the template you would just check for true or false to show or not the hard-coded image tag/s. Just an idea...

Re: Downloadable PDF in News article

Posted: Mon Nov 11, 2013 2:18 pm
by jakovbak
Hello Jo Morg!
Thank you for this tip! Actually, it never crossed my mind... I'll try and let you know how it works in this case.
Best regards,
Jakovbak

Re: Downloadable PDF in News article

Posted: Mon Nov 11, 2013 3:24 pm
by velden
What type of 'articles' are we talking about?
Are those normal Content Pages, News articles, Listit2 item?

Whatever it is I personally would probably create two 'select file' fields and a text field.

In the template I would check if the image select file field has a value, then show the image plus text. Else if the pdf select file field has a value show pdf icon and create link.

If you're using Listit2 or Content Pages for that, you can make use of GBFilePicker. It's has a user friendly way to browse for files, and upload files from within the same window.

News module also has the posibility to upload files and select those, but NOT to select a file from the uploads directory itself IIRC (News modules needs a unique directory per news item.

Re: Downloadable PDF in News article

Posted: Tue Nov 12, 2013 8:16 am
by jakovbak
Hello velden!
We are talking about News articles. Is it possible to add 'select file' field in News module? Default installation doesn't have such field. Maybe with CustomContent or something similar?
Anyway, this "improvised solution", in MHO, has two big advantages, at least from editor's point of view: first, it takes only two clicks to associate pdf icon with pdf document (which has already been uploaded to server), and second, if the icon is already inside my custom text area field, it serves also as a reminder for the editor, saying "This type of article should contain a PDF document for download!". Or something like that...
Let me know if I should provide my entire or partial code for the template I'm using for such articles, maybe it could help in some way...
Best regards and have a nice day!
Jakovbak

Re: Downloadable PDF in News article

Posted: Tue Nov 12, 2013 9:09 am
by velden
No, News has only 'File' field. It will allow you to upload one file (document in this case) and it will store it in a unique directory for the News article.

Really: ListitExtended (LI2) would be the way to go:

- user can select file from wherever you like (one click IIRC)
- YOU decide whether the editor can upload documents or not
- YOU make sure in your template that the PDF icon is connected to the link
- YOU decide how the output will look like (it's very easy for an editor to f*ck up your design with an wysiwyg editor)
- YOU decide that the field is required
- YOU decide what the Name of the module is in the Content menu (instead of 'News' you can name it anything you like)
- you can make as many module instances as you like (e.g. one for 'PDF document', one for 'Normal documents'

Use it once and you'll probably use it more often. I have a use for LI2 on almost every site: List of links, list of vacancies, list of opening hours, list of pictures for homepage cycler etc etc.