Auto Site Start MODx Resource Install Script

A while back I posted an sql install script that I use for MODx that I called ResourceInstaller. My plans of creating a module based around this script haven't materialized into anything yet, but the script has evolved a bit. I've renamed the sql script to AutoSiteStart because there was another project named similar to ResourceInstaller, and this script now installs more than resources. I wanted to take the time to post the sql script I'm using now since I think it shows a great way to get your development automated using MODx.


Download: [download#7]

This sql script installs:


  • HTML Chunks
  • HTML Templates
  • Snippet Chunks


  • Home Page Template
  • Inside Page Template

Template Vars

  • MetaDescription
  • MetaKeywords
  • ExtraHeadScripts
  • SectionImage

A few pages that I want installed by default:

  • Contact Us with a reference to the eForm ContactUs form
  • Contact Us thanks page
  • 404 Page
  • Site Map that uses WayFinder
  • A main menu include page

  • Head, Banner, Content, Footer chunks that are called in the installed templates.
  • Other chunks that I commonly use for eForm, Ditto, and WayFinder

The snippets that I've written and use on every site:

  • DynamicDescription
  • Title
  • CurrentYear
  • GetParentTitle
  • GetSubTitle
  • eformEvents


  • 1 'manager' user with the role of Manager (password is 'manager')


  • 1 Manager role with permissions to edit content.

This script should be considered to be pretty beta and should only be used if you know what you are doing (there's a bunch of todos/bugs listed in the file). I maintain and change this script on a local mysql database and when I make changes I just do a data only export. Also, this script is meant to be installed right after you install MODx, since I'm sure their would be some duplicate key errors if you install it after you've added some users or templates. The End