Blog Sections Open

Editing Snippets, Chunks, and Templates in an IDE with Git

A practical look at moving Evolution CMS elements out of the manager and into files so they can be edited in an IDE and tracked with Git.

Anyone who has maintained a medium-sized Evolution project knows the pain: editing snippets, chunks, templates, and TVs directly in the manager starts out convenient, then slowly becomes the kind of workflow that makes version control feel impossible.

This legacy article attacked that problem head-on. Its tone was rough, but the point was absolutely valid: if you want Git to be part of your workflow, your elements need to live in files, not only in the database.

The Problem

Classic Evolution lets you point elements to files, but doing that one by one through the manager becomes tedious very quickly. On a real project with dozens of chunks and templates, that turns into repetitive manual work and makes it harder to commit meaningful changes.

The Proposed Solution

the article introduced a Node.js module named modx-fs. Its job was simple:

  • pull chunks, snippets, templates, and TVs from the database into files
  • push those files back into the database

That meant a project could keep its editable source in the filesystem, work in a real IDE, and then sync those changes back into Evolution.

The Example

let modxFS = require('modx-fs');

let modxfs = new modxFS({
    host: 'database_host',
    user: 'userlogin',
    password: '******',
    database: 'database_name'
}, ['template', 'snippets', 'tv']);

modxfs.pull();
modxfs.push();

The example is intentionally small, but the workflow idea is the important part.

Why This Matters

  • you can edit elements in a proper IDE
  • changes become visible in Git
  • code review becomes possible
  • moving between environments gets easier

Even if you never use that exact Node.js tool today, the architectural advice still holds up: treat template code and element code like source code.

What the Author Planned Next

the article also outlined several follow-up ideas:

  • a built-in watcher
  • cache clearing after sync
  • creating elements in the database from a filesystem folder structure

Those ideas point to the same bigger goal: stop treating the manager as the only editing surface.

How to Read This Today

Modern Evolution projects have better package workflows, Composer-based development, and a cleaner Blade-first structure than the ecosystem had in 2018. Even so, this article remains a useful historical reminder:

if your project code matters, keep it in files and keep it under version control.

That principle is still one of the cleanest upgrades a team can make to its Evolution CMS workflow.

Source project: modx-fs on GitHub.

Newer post

Using Git in an Evolution CMS Workflow

A simple console-first workflow for creating and linking Evolution CMS elements from files so Git becomes part of day-to-day development.

Older post

Keeping Jot Working with Friendly URLs Instead of Numeric Comment Links

How to stop Jot-driven comment links from falling back to numeric document URLs on Evolution CMS sites with friendly URLs.