It's (Almost) Always Sessions

Is your site timing out or running slow? Do you notice it running a lot faster in your local development environment? Does it especially slow down as traffic rises? Guess what? It's (probably) sessions! What Are Sessions? Sessions are a common way to track a user's interactions on the server side. They are similar to cookies, but instead of being stored on the client's browser, they are stored within the server itself. Sessions are a great way to store temporary data while a user is visiting your site. They are mostly commonly used to tell if…

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