Using Fred with GPM in MODX 3

Update I've released a sample project using Fred + GPM to create a theme. You are welcome to use this as an example for setting up your own project! Getting Started | Set Up | Formatting GPM | Packaging Themes Getting Started with GPM GPM stands for Git Package Management, and is a powerful tool to build installable packages in MODX. I use GPM almost every day to create and update packages for projects I'm working on. To get started with GPM, you can follow my guide on creating a new package in MODX 3 using GPM. The basics that you will…

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"…