#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