MODX Community

Version 2.8 is out. Easy replacement of files (PDF, images) is axed, but fixed for 2.8.1

I’m late to the party , like usual. Anyway, with PDFs specifically, I like to use static resources for this very reason.

Internally name your PDFs with revisions and dates as you should, then the public facing pdf is a static resource named product.pdf or whatever. Now it’s still a simple upload.

1 Like

It would be very easy to turn this debate around to one of ‘best practice’ by suggesting that if you’re uploading another version of the PDF, then the name of that PDF should be different, most likely by incorporating a version number or date.

We have a few clients in a very similar situation. Once a PDF has been downloaded, there’s then a static copy of something floating around which can be distributed by some other means (e.g. email). It’s therefore important that this PDF is versioned, by date/number so that you know which version you have and whether it’s current.

To assist content editors, a single 301 redirect is maintained to point to the current/latest version of the uniquely named PDF. The PDF is linked to the ‘static’ link (which is redirected) in content so the editor’s job is to upload the new PDF, then amend the redirect to point to the new upload.

I don’t accept the “people are too busy to do something properly” argument. I find it better to help editors understand why it’s sometimes better to spend 10 more seconds doing something rather than the way they find quickest.

3 Likes

Ultimately, the solution to this in my mind is a combination of the setting that @markh implemented and the insertion of a confirmation dialog. Users should be able to replace files easily and have a UX experience similar to what they’re used to on their desktop OS. I’ve been working up some proposed changes in the media browser UI and can look into creating a confirmation dialog for overwrites as well.

That works OK for people not using CDNs. The static resource URL will have “.pdf” on the end, and will get cached by a CDN.

The best solution I’ve come up with for a client who has lots of different people updating sites and doing social media is to set up a template, using manager customization to display just three fields: the title, a file TV to link the PDF, and a text TV to display the full URL of the page. Users upload new PDFs with version numbers or dates or whatever makes sense. The template itself contains only a script that grabs the PDF name from the TV and then redirects to that PDF. This way, the public URL (which they send out in promo) will never change, it won’t get cached because it doesn’t have “.pdf” on the end, and it will always redirect to the current PDF. I made a simple plugin that dynamically puts the complete URL of the page in the URL TV field so that users can easily copy it and paste into whatever promo they send out (since the URL will redirect to the PDF, there is no way to grab it by viewing the page). Maybe not the best approach for SEO, but it solves all the problems this particular client was having managing these frequently changing PDFs.