Hello all,
New to MODx, looking to use it for a project. This project will be carried out by me and one other developer. My question, and I apologize if this is somehow obvious, is how can I use a version control system such as Subversion on MODx when pretty much all the configuration seems to be done in the database? The best idea I can come up with is to just do a database dump and check that in, but this is slightly tedious and prone to error. Is there a simple way? Thanks for the help.
You can keep most of the resources in remote include files (templates, snippets, plugins, modules) and use SVN to manage to remote files.
-
MODX Staff
- 2,502 Posts
You can use a snippet to call templates and chunks etc from HTML/PHP files in the filesystem. By default this is not how MODx is set up but you are certainly welcome to do it. You can even go so far as to take DB snapshots.
As far as content goes it makes more sense to do that post dev but that too could go into html files but if that is the case you may as well build in HTML.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
Thanks for the help. It would seem from these responses that most people are not using version control when developing MODx sites?
Question:
How do you keep your DB under version control?
Mostly Modx is in the database (except images and some snippets) but you could move your templates, snippets and even chunks in files.
From my knowledge you can only keep sql scripts in a version environment not the data.
For example a template can look like this in the DB
[[includeFile? &path=`templates/site/template1.html`]]
template1.html will contain all the html, chunks and snippets
This way you can keep all the templates in a folder and manage it using version control.
PS: These are just ideas. I’m not using a version control system for my websites. I personally would like to use one but it seems to complicated for small sites.