Static Resource

Skip to end of metadata
Go to start of metadata


What is a Static Resource?

A Static Resource is a Resource abstraction of an actual file on the filesystem. You can think of the abstraction as a virtual representation of any file on your webserver. Like other MODx resources, this abstraction can have permissions associated with it and it shows up in the MODx manager in the resource tree, which allows it to show up in dynamic menus and search results. A MODx Static Resource can represent any file on your webserver (permissions permitting).

Static Resources can also have tags inside their content fields to determine the path of the file - so you can specify custom paths to set as System Settings, or use Snippets to dynamically find the path.

They behave exactly like a Document (standard Resource). Content within a Static Resource is parsed and displayed in the exact same way as a Document, but often you will alter the Content Type and Content Disposition to match the type of file you are representing.

About Aliases
When you create a Static Resource, the alias should not include a file extension: the file extension is determined by the Content Type. For example, if you create a Static Resource that points to a PDF file on your webserver, you might give the page an alias of "test". Once you select "PDF" as your Content Type, the ".pdf" extension will be appended to the alias (presuming that you have defined the PDF content type using ".pdf" as its file extension).

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.