I have spent a lot of hours over the last couple of weeks really digging into Modx. I keep finding myself pleasantly surprised at how flexible and easy to use it is. I have also discovered that their forums are very well supported and often receive answers within minutes of posting my questions.

I have recently been delving into the use of Modx Template Variables (TV) to create a surprising level of flexibility within the framework. My rudimentary efforts began with a desire to improve a web page featuring a google map with landmarks. I built the page about a year ago and have recently redeveloped the back end of the site. As I have worked on the site I have incorporated a relative font resizing feature for improved accessibility but found that my map was excluded from the upgraded functionality. My original solution, in Modx, was to provide the content code through an iframe. The map was not under the direct control of my CSS documents.

As I began to rework the page I realized that if I went with a more traditional solution I would have to create the JavaScript calls for the map functions from within the header of the document. As this is a pretty involved map just the JavaScript call was 230 lines of code. This was really too much weight to place on the site header and was the antithesis of my recent efforts to improve accessibility and decrease overall page coding.

Example: Template VariableAgain, Modx and the forum provided an elegant answer. I created a TV using a Textarea input type and an @INHERIT Default Value (@BINDINGS). Next I place the new TV ([*newTV*]) into my header.

All that was left was to return to the page in question and insert my JavaScript into the newly created TV text area for that page.

Once the page was completed I quickly realized that this technique could be used for similiar pages, like our contact forms which require a large amount of coding in the <head> tag as well, but that is specific to a single page within a common page template.

I have also been reading about further uses of the @INHERIT bindings to take advantage of the hierarchical structure of the document tree to affect sectional changes when placed in a parent document. Although I haven’t tried this to date, you can see an example on the page from the link above.

As I have been broadening my investigations for Modx resources I have also found this YouTube link which might provide some useful information to anyone evaluating this CMS.