I have noticed from time to time that someone sends a tweet requesting MODx resource information. I can tell you that there are lots of folks doing really great work with MODx tutorials, like these at The Coding Pad.
While I personally haven’t yet written any MODx tutorials I thought it might be useful to identify some of the snippets/plugins that I use on a day to day basis. I am not looking to elaborate on some of the most commonly used snippets like Ditto or Wayfinder. I am hoping to illuminate some of those little golden bits of code that I find very useful if not a little hard to find.
CopyYears Snippet
This tiny little snippet comes in very handy. CopyYears simply updates the copyright year automatically. I realize that this may seem a little on the lazy side but when you manage dozens of MODx sites like we do here at Pleth it is very useful.
randomDoc Snippet
This is a simple and useful snippet that I have used in many instances. It randomly returns a single document within a directory. You should have all the standard MODx fields (and I believe Template Variables too) available to you. I was not able to track down the original source for the randomDoc snippet, so I am linking to my previous article on this topic (randomDoc Snippet).
sitemap Snippet
I realize that there are multiple methods for creating an XML sitemap on your MODx sites. My tried and true approach has been to use the Sitemap Snippet. Once again, it’s simplicity and ease of implementation make this an attractive solution for my sites.
getField Snippet
getField has quickly become one of my go-to snippets. It allows you to look up the document tree and retrieve fields from parent documents. In a previous post I outlined my method for piecing together code from multiple getField call ins.
documentMan Snippet
documentMan is a snippet I probably use the most widely. It allows you to quickly build lists based on the contents of any given directory. This can become a great timesaver as you do not have to hand code long lists like photogalleries. It also allows an end user to add to listings by simply uploading their document into the appropriate location and any accompanying code is written by the snippet. You can see an example of this in action in the Pleth Portfolio.
FeedX Snippet
FeedX, very handy:
FeedX is a universal XML feed reader for MODx. Rather than being limited to specific formats, the snippet is capable of parsing and rendering nearly any XML format (RSS, RDF, Atom, you name it). In addition to functioning as a snippet, FeedX’s class may be called by 3rd party snippets/plugins/modules as a simple method of retrieving cached and parsed XML data.
EZfaq Snippet
While EZfaq is very useful as intended I have found that with a little imagination it can be used to present all sorts of data. You can see it in action on the Pleth Policies and Procedures page.
ManagerManager Plugin
I elaborated on the ManagerManager Plugin in a recent post. Since writing that post I have continued to discover just how great this plugin is. If you are wanting to get into some serious MODx development you really need to learn the ins and outs of this powerful plugin.


