Ever since Kevin Shay released the brilliantly named BigPAPI plugin, plugins have been able to change Movable Type's interface extremely easily. With Movable Type 3.3, this functionality was built into the core and this opened the floodgates for "Transformer Plugins" - as they've come to be known! All (or at least the majority) of Transformer plugins work by first looking for a marker (a few lines) in an app template page and then either adding to it or replacing it with something of their own. Now besides being extremely crude (if there was the slightest change to the marker, the transformer plugin would collapse complete), this presented the problem of multiple transformer plugins using the same marker. For example, if Plugin A was to modify a marker used by Plugin B, well Plugin B would no longer work! And this proved to be quite a nightmare for support.

In Movable Type 4, along with the new interface, the entire backend app templates were rebuilt using Movable Type's own templating system. Besides being far more powerful than it's predecessor HTML::Template, it allowed for a whole new set of API to be built. This new API implements the DOM methods native to JavaScript. The DOM can be quite complicated to wrap your head around (in fact, it took me several months to truly feel confident) so here are a few tutorials to familiarize yourself with it before tackling Movable Type's DOM:

With Movable Type 4, a lot of these DOM methods have been built into the system and can (and should) be used instead of the regexes. They should be called on MT::Template objects (and thus can be found in lib/MT/Template.pm) and work by modifying nodes/elements (template tags) in the template. Lets look at how to build a Transformer plugin with these new methods.