Like many applications, Modx assigns the handling of specific content types so that they can be correctly opened in browser by applications within your computer. A content type is an identifying extension that allows protocols such as HTTP to identify a file type so that the internet browser knows how to handle the file. In email, content type is often called a MIME type (Multipurpose Internet Mail Extensions). When the extension of the file is recognized, the internet browser (or email application) understands how to open the file if, for example, it were a file such as an audio file or video file. Modx handles these settings for the different resource types that you may use. Since Modx is generating the page, it will need to know how certain file types should be handled. Modx content type settings can be added and viewed within the System menu of the Modx Dashboard. The following article steps you through finding these settings and adding to them as needed.
Setting New Content Types in Modx
- Login to the Modx Administrator Dashboard.
- Hover over the menu bar where it says SYSTEM and then click on CONTENT TYPES when it appears in the drop-down menu.
- The Content Types screen will show you the types that have already been assigned. Here's an example of the default settings:
The following table defines the settings in the columns above:
||Modx internal identification number
||Name of the content type
||Description of the content type
||Identifies the file type for your browser
||Extension used at the end of the file name
||Identifies if the file is ASCII or Binary (ASCII file contains text and a Binary file is encoded groups of numbers - for more detailed information on understanding a Binary file see Definition of a Binary File).
Click on the NEW CONTENT TYPE button in the top left hand corner.
- Fill out the form that appears in order to create a new content type.
- Click on SAVE to save your new content type settings.
Content Type Example Added and Edited
The following screenshot shows an example of a new content type that has been added. The content type is a Windows Media Audio file or WMA file. The Content Settings for this file type are audio/x-ms-wma (specific details for MIME settings of Windows Media files can be found here: MIME Type Settings For Windows Media Services). Note that each content type entry can be modified. To edit the entry, simply double-click on the text entry and an editable field will appear with the current setting. When the entry is edited, you will see a red triangular mark appear above it as in the screenshot below. When you have finished making your changes, simply click on SAVE in the top right hand corner and the marks will disappear and you changes saved.
The settings are reflected in the screenshot below:
Adding a new content type allows you to have the content opened by a set application through your internet browser. For example, if you have a video file embedded in your website and your browser recognizes the file that's being opened, it knows to open a specific type of video player so that the file can be viewed in your browser. Add content types to Modx so that specific files are opened correctly when your Modx website is being viewed.