We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14568
    • 14 Posts
    I am wondering how to version control site changes in Revo sites.

    We're a small development agency with 3-4 people who will be editing sites, git repositories enable us to not only track changes but also helps understand why the change was made which cuts down on the time needed to make future changes.

    Currently in other systems that we develop on we version control the template folders, and also where appropriate the entire CMS if any core hacking takes place. Obviously this isn't necessary in MODX. So I can commit the CSS and JS folders for the template into git, but templates, snippets and chunks that we use are a little more difficult to get control of.

    I have thought of writing an export script that exports changes to flat files and these are then committed to a git repo. However this seems a little Heath Robinsonesque and not very stable.

    If anyone has wise insights into controlling site changes, please chime in.
    • In 2.2 you can simply use static elements.

      Before 2.2, you can use an include snippet which could be as simple as this (multiple variations lurk around the forums and docs):

      (name it "include" or something)
      if (file_exists($file)) return include $file; 
      return 'File '.$file.' does not exist.;
      


      And in your MODX templates/chunks use [[!include? &file=`my/path/to/template/home.tpl']]

      There's other solutions as well. like Digital Butter's FEM and I am working on a complete rewrite of VersionX that also versions elements (including templates, chunks and snippets). It already does the saving, but is lacking a UI for everything but resources. I welcome people to help out getting it ready for a release.. smiley

        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.