MT-SetVarBlock is a simple lightweight MovableType plugin for storing a block of template code into a variable. The plugin features one container tags of MTSetVarBlock. Full documentation is embedded in the plugin code for now.
I've found this plugin infinitely useful to the way I develop sites. I like to develop my sites in an object-oriented way. With MT and other systems I've used, I found myself repeating a lot of "framing" template code to wrap a unique layout for the body despite my best efforts. Ideally, and in object oriented fashion, I'd like to take a template and stick the result of a specific layout in the middle. However with MT's templating system (particularly MTSetVar) this is not possible since value is set as string passed as an arguement in the tag. To keep layout seperate from content and keep code redundency to a minimum required some mesy and somewhat confusing measures. I developed MTSetVarBlock to remedy these issues by letting me store a block of template code into a variable that a global template can call.
The tag is pretty simple and I've attempted to do a through test, but I could have missed something. Please use with care and let me know if you find any bugs. Hopefully it will be as helpful to other as it is to me.

Leave a comment