Static resources are basically representations of a file that exists on your server. For example, you can setup a static resource to represent a PDF file on your website. These resources can have properties such as templates applied to the page and then directly referenced in the Modx website. The following article walks you through the steps of setting up a static resource within the Modx Dashboard.
Adding a Static Resource to Modx
- Login to the Modx Administrator Dashboard.
- Hover over the menu bar where it labeled SITE, then click on NEW STATIC RESOURCE when the drop-down menu appears.
- You will see the following for creating the STATIC RESOURCE:
The TITLE field is required, so click in the field and give the new STATIC RESOURCE a name. There are many settings available for each static resource, but for the purpose of demonstrating the addition of the resource, simply fill out the fields in the STATIC RESOURCE tab (the fields shown in the right side of the screenshot above).
- When you get down to the last field, there is a drop-down arrow at the arrow right. Click on this arrow (the field labeled STATICRESOURCE at the bottom of the form). It will open the following dialog:
Use this dialog to upload a file that will become your static resource.
- After you have uploaded the file, click on the checkbox next to PUBLISHED in order to see the page.
- Once the static resource is set, click on the SAVE button in the top right hand corner to save your entries.
Static resources are generally exactly what the name implies, resource files that remain the same and do not change. They can often be large text files or documents that can be referenced within the Modx website. You can apply templates to them as you would any page in the Modx website. One of the advantages of using a static resources is being able to display a large document without having to re-type it into the Modx website. Here's an example of using a static resource. In this example it is displaying a long text document within a downloaded template: