As you begin to use Modx, you will encounter many files and references to files. Modx provides a very useful way to view and make changes to these files with the tree-style interface to the left of the backend manager. Here’s a screenshot indicating its location:
Modx reads the resource files that you incorporate into the website that you are creating. These files all have a type and Modx refers to them as Content Types. Each content type is associated with a file extension that identifies the file so that it is properly rendered by Modx. For example:
Each of these files are text files (you can open them and read them in a text editor), but the file extension tells Modx that the file should be displayed a certain way. Since samplesite.html indicates it is an HTML file (Hypertext Markup Language- a web specific file), Modx is able to identify the file and display it as a web site file as opposed to a simple text file.
Here’s a list of the file types that you can typically create as a resource in Modx:
Adding New Content Types to Modx
There will be occasions when you receive a file that cannot be parsed by Modx. This may require that the file type be added to the content types supported by your installation of Modx. This can be done in the Modx Backend under the System menu.
- Login to the Modx Backend Manager.
- Hover over the menu bar where it says SYSTEM, then click on CONTENT TYPES when it appears in the drop-down menu.
- When you click on the menu item, you will typically see the list of content types that have already been added. There's typically 7 types added by default. Here's a screenshot what you may see:
- Click on NEW CONTENT TYPE in order to add a content type not listed.
||Name of content type
|| Stands for Multimedia Internet Mail Extensions- identifies the information within the file
||Identifies the file type that will be rendered by Modx
||Indicates if file is Binary or ASCII/text
||Describes the content type
- Click on SAVE when you have completed making your entries for the new content type.
Note on Friendly URLs
For SEO (Search Engine Optimization) requirements, an option called search-engine-friendly (SEF) URLS is often enabled. This option affects the resource because a resource is typically listed in a normal URL. However, in an SEF URL, the resource is replaced by an alias that is determined by the FILE EXTENSION designated for that resource type.
Becoming familiar with content types enables you to recognize the file types that you will be using while working within Modx. The tree-style view grants you immediate access to the files, which is a strength of the Modx interface. Your knowledge of the content types helps you to directly manage your files without having to find them with an FTP client or through your hosting file management interface.