As you may have noticed at the top of this site I scan in and post all QSL cards I receive, broken down by year. More than anything I do this to show off some of the amazing photos and art I receive. However, I also see it as a historical archive. One day you may search for your own Call Sign and get linked to this page, where you sent a QSL card 10 years ago and it brings back memories.

Regardless of the reasons I set out to do this and had some trouble, here are my stories.

First off was scanning in the cards. I have a great little HP Officejet printer with a flatbed scanner on it, but man this method took forever. It isn’t duplex, so I had to scan the front of the card, then flip it over and scan the back. This gave me a multipage PDF, both front and back of the card, but took a lot of time. I quickly gave up on doing it this way.

Recently I broke down and bought a Scansnap i1500 scanner. Now I did not buy it for this purpose, because that seemed just crazy because of the price tag. However, I have been slowing moving toward a paperless office / life, and the Scansnap was the center of that workflow. It’s a neat piece of kit, but not the subject of this article.

On the Scansnap I learned after some trial and error that I needed a “Documents” profile. If I left it to Auto then most cards would scan as a document, and as such a PDF, but occasionally it would choose “Photos” and that didn’t work. Why? Well in a Document scan it would duplex scan the front and back of the card, at the same time mind you, and create a 2-page PDF for me. JPEGS have no concept of “pages” so when it selected the Photos mode I would get two jpg files, and that was sloppy and left me with more work of combining them. So… lesson was, force it to scan as a Document. Once I did that, scanning all the cards was very quick work, and I received nice two-page PDFs for each card. Perfect…

Next was uploading it to the website and displaying them. Complication number 2. I really didn’t want to clutter up my Media section of WordPress but I had a bigger problem, displaying thumbnails of PDF files in a gallery and letting a user click on them to load the whole PDF. Believe it or not, WordPress did not support this, and PDFs are documents, not images, so I was blocked.

I started scouring the Plugins section of WordPress for a solution, and there were several if you wanted to shell out some cash to solve the problem, but I was trying to avoid that for the time being. My search terms were things like PDF, Document Gallery, etc. All turned up choices, but all cost money.

Then I changed it up a bit and for some reason did a search for Media and found the answer. In the WordPress Plugins director is a neat little free extension to the native WordPress Media controls called Media Library Assistant. This thing added a whole bunch of new functionality to the Media section of WordPress, and it also offered a solution to my problem.

First, uploading all the PDFs. There was a lot of them, and I wanted to categorize and tag all at once, plus I wanted to disable comments on each of them and attach each to parent page. Done, easy, Bulk Upload from MLA did that for me no problem.

Next was displaying them “gallery style” on a page and allowing a user to click on a card they wanted to see. This is where MLA really extended the functionality in WordPress, all for free, but with a little bit of work. See MLA works by using “shortcodes” and this means a lengthy string of parameters to figure out. The below is where I landed on that shortcode, and I’ll explain it afterwards.

[mla_gallery link=file size=full columns=2 post_parent=all post_mime_type=application/pdf attachment_category=qsl-cards-2018 mla_target="_blank"]

Breaking it all down:

  • [mla_gallery – This opens the shortcode and starts the sequence. Everything following is a parameter to customize its default behavior.
  • link=file – Super important. This parameter tells MLA to make the clickable link of the card the “permalink” of the PDF itself. This means when someone clicks it, they get the PDF in their browser directly. The default behavior was to open the WordPress media page for the file, which just created another click for the user, and it was sloppy.
  • size=full – This just made sure the thumbnails were as big as possible on the page.
  • columns=2 – This set it to display 2 columns of thumbnails on the page.
  • post_parent=all – This told MLA to include all mime types, regardless of what page they were attached to. If you attach the image to the page, this isn’t needed, but you’ll see in a minute I included everything then filtered by a category later.
  • post_mime_type=application/pdf – This limited the gallery to only displaying media of type PDF. All my cards were PDFs.
  • attachment_category=qsl-cards=2018 – Remember earlier when I said I filtered it down? Here’s the filter. When I uploaded the cards I did them by year, and I categorized them at upload to WordPress by year as well. This allowed me to only show 2018 cards on the 2018 page, etc.
  • mla_target=”_blank” – This of you familiar with web development know this is the magic term used to open a link in a new tab or window. I added this so any card the user would click wouldn’t take them away from my site, but open it in a new tab.

That’s it. You just create the page, insert that shortcode and modify the category as necessary, and you end up with a nice gallery of PDF thumbnails that are clickable and open into a new tab. Took me a while to work it all out, but it’s there and free.

Next project, getting my QSO log to update the website in real time as I add entries. Log4OM provides some of the functionality, but I’m not serving up static HTML webpages, so it’ll take some magic on the backend. Once I figure that out, there will be another post outlining it.

Tags:

Comments are closed