Static Resources and Elements
When working in collaboration, teams of developers and designers often collaborate via Subversion (SVN) to make development easier between multiple people. MODx, however, stores its data in the database. This has many benefits generally, but DB-stored code cannot be version-controlled via SVN.
However, the solution in MODx Revolution is quite simple.
For Resources, it's simple. Just use Static Resources, and point the content to a file in your SVN checkout.
The following is relevant to older versions of MODX. For MODX 2.2.x, as with static resources, simply use Static Elements. Static Elements have the further advantage of being able to use Media Sources.
For Elements, all you need is a simple "include" snippet. The code:
if (!file_exists($file)) return ''; $o = include $file; return $o;
You can then call it like so in your Static Resources:
And you're done. You can also use tags within the 'file' parameter, such as this: