Showing articles from all topics (13)

Modx get Formit Forms

Fri Jul 14, 2023

The Formit Extra for Modx is a versatile snippet that makes form handling a breeze. One of its abilities is to encrypt and store submitted form data which can be accessed through the Formit CMP. But what if you want to access those stored forms and display them on the front end? A number of years ago I submitted a quick and dirty way of accessing Formit form data using a raw SQL statement, today I'd like to show you my new method for accessing and decrypting Fomit form data.

Read more

Cache busting in Modx

Thu Jul 06, 2023

In the fast-paced world of web development, ensuring that your website serves the latest version of stylesheets and scripts is crucial. Cache-busting techniques play a vital role in achieving this goal. In this article, we will dive into the world of MODX CMS and explore various methods to add cache busters to stylesheets and scripts. From manual versioning to leveraging built-in features and an alternative code snippet using filemtime(), we'll equip you with the knowledge to optimize your website's performance and deliver an up-to-date user experience. Let's get started!

Read more

getMany() with newQuery()

Fri Jun 30, 2023

Did you know you can use the Modx newQuery() method to enhance your getMany() relationship calls? In this article, we'll quickly look at a scenario where this could come in handy.

Read more

Export & import large MySQL Database

Thu Dec 01, 2022

Working with large MySQL databases can be a right pain in the ass! I've found the best way to import/ export large databases is to use the command line rather than PHPMyAdmin or a program like Navicat. Here's how to export & import MySQL Database using a few simple commands over SSH.

Read more

Generating images using phpThumb()

Mon Nov 21, 2022

As developers, we must ensure that the sites we build not only look good but perform well and the easiest way to gain a performance boost is by serving properly optimized images. We'll be looking at the pThumb Extra to generate out different image sizes, crops, and formats all on the fly

Read more

MODX magic link login tutorial

Wed Nov 16, 2022

We've become so used to passwords that we've created tools just to help us keep track of them all. In recent years magic links have started to become more popular in an attempt to make our lives easier. For this tutorial, we'll be building the basics of a passwordless login for MODX. Ideally, this should be implemented with a 2fa or other identity-confirming method to ensure authenticity, but we're only looking at the basics.

Read more

Login a MODX User with the API

Thu Nov 03, 2022

This thought experiment article explores a number of different methods for logging users into a MODX context using the API. With simple snippets or endpoints, we can handle the creation of new users, search for registered users and log them in without them having to physically sign in.

Read more

How to watch global variables in VUE JS

Wed Jul 20, 2022

VUE JS is amazing, there's no doubt about it. But there inevitably comes a time when your shiny new app needs to do something when an event is triggered outside of its scope. This can present a problem but with watchers and VUE observables it's super simple to manage. This short article is a quick demonstration of I implemented a VUE watcher on a global variable during a recent project.

Read more

HTMX & MODX a match made in heaven?

Mon Jul 18, 2022

HTML-over-the-wire is a method whereby an AJAX request returns HTML instead of JSON. This methodology allows us to quickly build reactive, modern interfaces with the tools we use every day. MODX is the ideal CMS for working with HTML-over-the-wire as its powerful template syntax, combined with chunks and output modifiers enables us to write our logic directly in our templates. HTMX is one of a number of libraries that enable HTML-over-the-wire using simple HTML attributes. This article looks at HTMX and how to integrate it with MODX to enhance your websites and create more powerful applications.

Read more

MODX one liners and Output modifiers

Sat Jul 16, 2022

MODX Output Modifiers bring PHP logic into HTML. They enable you to generate DateTime stamps, image thumbnails, IF statements, set defaults and pretty much anything else you can think of. In this article, we'll look at some of my favourite MODX output modifiers and how you can create your own.

Read more

Accessing single characters in multibyte strings

Tue Jul 12, 2022

This article explores an issue I faced when working on a Danish language website which required me to build an A-Z filter list using different strings. The issue I faced was down to UTF8 Special characters and multibyte characters not working as expected when trying to access individual characters from a string.

Read more

How to setup and use MIGX TV for MODX

Sun Jul 10, 2022

One of the reasons why MODX is our CMS of choice is because of its innovative template variables. Simply put, a template variable is a custom field for a MODX resource, this means we can add extra information to a resource/ webpage without having to hand-code or 'Hack' it in. Please note that this is a very long article with a few tricky bits, take your time reading it to be sure you understand everything.

Read more

Multilingual websites with MODX

Sun Jul 10, 2022

Our world is constantly growing! With international trade at all-time highs, businesses are continually searching for new global markets. The difficulty that many companies face with multinational expansion is dealing with different cultures and languages. It is vital for companies working globally to tailor their website to meet the needs of their customers no matter where they are. This article walks you through the basics of setting up Babel for MODX.

Read more