How can we change image resolution with the URL name?

The following site is using some type of image resizing system where if you change the number 570 near the end of the URL it changes resolution to that size of image.

Does anyone know how they might be doing this and if it is possible in MODx?

You can do something like this by rewriting the request URL.

You could for example convert the URL


and then run a script on the page “yourpage” that generates a thumbail of the image “SomeImage.jpg” with a width of 570 and returns it.

In MODX the rewrite is usually done by creating a plugin that runs on the event OnPageNotFound where you parse the URL, set the request parameters and forward the request to the correct resource.

1 Like