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
- W3C School's XML DOM Tutorial
- Mozilla's DOM Developer Docs
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.