Docs Navigation Open

Events and Modifiers

Use system events and built-in modifiers for targeted customization without rewriting larger parts of the project.

Events and modifiers are two of the simplest ways to change behavior without rewriting the whole project.

Events

Plugins subscribe to named events fired by the manager, parser, or request lifecycle.

  • OnDocPublished
  • OnDocUnPublished
  • OnWebPagePrerender
  • OnLoadDocumentObject
  • OnManagerLogin
if ($modx->event->name === 'OnDocPublished') {
    $id = $modx->event->params['id'] ?? null;
    // custom sync or logging here
}

Modifiers

Modifiers transform values directly in tags. They are useful when output needs a lightweight change without writing a full snippet.

[*pagetitle:limit=`50`*]
[*createdon:date=`%d.%m.%Y`*]
[+price:math=`?*[+rate+]`+]

Classic Modifier Layer

Older projects often rely on PHx for conditions and output transforms. In Evo 3, built-in modifiers, snippets, and Blade are often enough, but PHx still matters in legacy maintenance.

Rule of Use

  • use an event when logic must react to a lifecycle moment
  • use a modifier when you only need to transform output
Previous

Extending Evolution

Use service providers, controllers, views, migrations, classic assets, and manager modules to extend Evolution CMS in a package-friendly way.

Next

Data Model

Review the main Eloquent models used by Evolution CMS and how resources, TVs, users, permissions, and code elements relate to each other.