#MODX Quick Tip: PDF Content/MIME Type

MODX Resources are handy things. You can list them with getResources or Wayfinder and do any number of cool things with them, thanks to the Uber-Powerful MODX Framework.

To extend all that functionality to a static resource on your site (like a PDF file) all you have to do is create a Resource with the Class Key of modStaticResource and the corresponding Content Type. These fields are both found on the Page Settings tab when your editing a Resource.

One problem you might run into is that MODX doesn't come with PDF as a default Content Type. This is easy to fix. In MODX's main menu, go to: System » Content Types. Click "New Content Type" and in the modal window, enter the following values (see screenshot below)

MODX PDF Content TYpe

Click Save and you're done!

For more information about different Content Types, visit: http://www.digitalpreservation.gov/formats/fdd/fdd000030.shtml

Here's the MODX Official Documentation on Content Types: http://rtfm.modx.com/display/revolution20/Content+Types



YJ has over 20 years in media and communications. He published his first website in 1994, got his first SLR in 11th grade, and has over 60 professional film and TV credits. In 2005 he started a successful renovations company and managed millions of dollars worth of projects and sales. Now he's uber excited and proud to be part of the MODX team, doing anything and everything he can to contribute to his favorite piece of software.

blog comments powered by Disqus