Creating Custom Fatal Error Pages in MODX

MODX has a built in setting named error_page, but that is primarily for just handing 404 type errors when a URL string doesn't match a resource. What happens when your visitors experience other types of errors? In this article, I will discuss how to add custom error pages to your MODX site and to your MODX Cloud instance. Create an Error Page The first thing that you need to do is create an error page. I highly recommend keeping them simple. It should be a single HTML page that gets the point accross. You can take your 400 page as a basic example,…

Testing your site for PHP 8 Compatibility

The end of life for PHP 7.4 is fast approaching, and many of us are working on a strategy to update and test your sites. If you have a lot of sites or a large project you need to get compliant before the switchover, this article will guide you through the initial testing. Install Composer Depending on your host, you may or may not already have composer installed on your environment. If you do not, you can read the get started guid here: getcomposer.org. For those of you lucky enough to be hosted on MODX, it is as easy as SSHing into your site…

Creating Custom Packages with MODX 3 + GPM

MODX 3 brings a lot of changes with how packages are loaded. We finally have FIG standard compliant name spacing and autoloading, bringing with it a new way to package your extras. While updating the classic application GPM, or Git Package Management, theboxer (a.k.a. John) added a new feature to create a package. At the time of this writing, there is a pending pull request to close a few issues. However, it works very easily to get started with a new package. In this article, I am going to walk through the basic steps to generate a new "boilerplate"…

Customize elFinder in MODX Fred

Fred is a highly configurable frontend editor for MODX. With over 13K downloads, it's safe to say that it has taken off! One of the problems I recently encountered was configuring it to have some of the same image normalization standards I would normally use plugins like FileSluggy or a custom script for image handling. Since Fred uses elFinder for handling the image, it doesn't tap into the regular MODX system events. However, elFinder has it's own plugins that can be tapped into.  Create a custom plugin Fred exposes an event called "FredOnElfinderRoots"…

Extensions I replaced with Bookmarklets

I am often trying different browsers, and found that on of the biggest issues between switching is moving all of my extensions over. Especially if those extensions do not have a one-to-one alternative on said browser. It was during my time with Safari that I started to realize that quite a few of my "extensions" could be replaced with simple bookmarklets. In an effort to spread the word I will share a few of my really commonly used bookmarklets as well as how I create them.  Creating a Bookmarklet This is the easy part. Quite a few services that…