System Events
Last updated Oct 14th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moreWhat are System Events?¶
System Events are points in the MODX code where Plugins run. MODX fires them throughout its code, so a Plugin can hook into any step without editing the core.
The Model of a System Event¶
The system events table is {table_prefix}_system_eventnames with these fields:
| Field | Description |
|---|---|
| id | Unique ID of the event. |
| name | Event name, referenced in code via modX.invokeEvent. |
| service | Type of system event. |
| groupname | Used by user interfaces to filter, group, and sort events. The MODX model does not use it. |
Service Types¶
The service field holds a number that identifies the type of event:
| Value | Service |
|---|---|
| 1 | Parser Service Events |
| 2 | Manager Access Events |
| 3 | Web Access Service Events |
| 4 | Cache Service Events |
| 5 | Template Service Events |
| 6 | User Defined Events |
Service 3 does not fire in the mgr Context; Service 2 fires only there.
Available Events¶
The events below are grouped by the groupname shown in the Manager’s event list. For the full list of registered events, see transport.core.events.php.
Categories¶
Chunks¶
- OnBeforeChunkFormDelete
- OnBeforeChunkFormSave
- OnChunkBeforeRemove
- OnChunkBeforeSave
- OnChunkFormDelete
- OnChunkFormPrerender
- OnChunkFormRender
- OnChunkFormSave
- OnChunkRemove
- OnChunkSave
Contexts¶
- OnContextBeforeRemove
- OnContextBeforeSave
- OnContextFormPrerender
- OnContextFormRender
- OnContextInit
- OnContextRemove
- OnContextSave
- OnContextUpdate
Internationalization¶
Media Sources¶
- OnMediaSourceBeforeFormDelete
- OnMediaSourceBeforeFormSave
- OnMediaSourceDuplicate
- OnMediaSourceFormDelete
- OnMediaSourceFormSave
- OnMediaSourceGetProperties
Package Manager¶
Plugin Events¶
Plugins¶
- OnBeforePluginFormDelete
- OnBeforePluginFormSave
- OnPluginBeforeRemove
- OnPluginBeforeSave
- OnPluginFormDelete
- OnPluginFormPrerender
- OnPluginFormRender
- OnPluginFormSave
- OnPluginRemove
- OnPluginSave
Property Sets¶
Resources¶
- OnBeforeDocFormDelete
- OnBeforeDocFormSave
- OnBeforeEmptyTrash
- OnDocFormDelete
- OnDocFormPrerender
- OnDocFormRender
- OnDocFormSave
- OnDocPublished
- OnDocUnPublished
- OnEmptyTrash
- OnResourceAddToResourceGroup
- OnResourceAutoPublish
- OnResourceBeforeSort
- OnResourceCacheUpdate
- OnResourceDelete
- OnResourceDuplicate
- OnResourceRemoveFromResourceGroup
- OnResourceSort
- OnResourceTVFormPrerender
- OnResourceTVFormRender
- OnResourceToolbarLoad
- OnResourceUndelete
RichText Editor¶
Security¶
- OnBeforeManagerLogin
- OnBeforeManagerLogout
- OnBeforeResourceGroupRemove
- OnBeforeWebLogin
- OnBeforeWebLogout
- OnManagerAuthentication
- OnManagerLogin
- OnManagerLoginFormPrerender
- OnManagerLoginFormRender
- OnManagerLogout
- OnPageUnauthorized
- OnResourceGroupBeforeRemove
- OnResourceGroupBeforeSave
- OnResourceGroupRemove
- OnResourceGroupSave
- OnWebAuthentication
- OnWebLogin
- OnWebLogout
Settings¶
Snippets¶
- OnBeforeSnipFormDelete
- OnBeforeSnipFormSave
- OnSnipFormDelete
- OnSnipFormPrerender
- OnSnipFormRender
- OnSnipFormSave
- OnSnippetBeforeRemove
- OnSnippetBeforeSave
- OnSnippetRemove
- OnSnippetSave
System¶
- OnBeforeCacheUpdate
- OnBeforeManagerPageInit
- OnBeforeRegisterClientScripts
- OnBeforeSaveWebPageCache
- OnCacheUpdate
- OnElementNotFound
- OnFileCreateFormPrerender
- OnFileEditFormPrerender
- OnFileManagerBeforeUpload
- OnFileManagerDirCreate
- OnFileManagerDirRemove
- OnFileManagerDirRename
- OnFileManagerFileCreate
- OnFileManagerFileRemove
- OnFileManagerFileRename
- OnFileManagerFileUpdate
- OnFileManagerMoveObject
- OnFileManagerUpload
- OnHandleRequest
- OnLoadWebDocument
- OnLoadWebPageCache
- OnMODXInit
- OnManagerPageAfterRender
- OnManagerPageBeforeRender
- OnManagerPageInit
- OnPageNotFound
- OnParseDocument
- OnSiteRefresh
- OnWebPageComplete
- OnWebPageInit
- OnWebPagePrerender
Template Variables¶
- OnBeforeTVFormDelete
- OnBeforeTVFormSave
- OnTVFormDelete
- OnTVFormPrerender
- OnTVFormRender
- OnTVFormSave
- OnTVInputPropertiesList
- OnTVInputRenderList
- OnTVOutputRenderList
- OnTVOutputRenderPropertiesList
- OnTemplateVarBeforeRemove
- OnTemplateVarBeforeSave
- OnTemplateVarRemove
- OnTemplateVarSave
Templates¶
- OnBeforeTempFormDelete
- OnBeforeTempFormSave
- OnTempFormDelete
- OnTempFormPrerender
- OnTempFormRender
- OnTempFormSave
- OnTemplateBeforeRemove
- OnTemplateBeforeSave
- OnTemplateRemove
- OnTemplateSave
User Groups¶
- OnUserAddToGroup
- OnUserBeforeAddToGroup
- OnUserBeforeRemoveFromGroup
- OnUserGroupBeforeFormRemove
- OnUserGroupBeforeFormSave
- OnUserGroupBeforeRemove
- OnUserGroupBeforeSave
- OnUserGroupFormRemove
- OnUserGroupFormSave
- OnUserGroupRemove
- OnUserGroupSave
- OnUserRemoveFromGroup
User Profiles¶
Users¶
- OnBeforeUserActivate
- OnBeforeUserDeactivate
- OnBeforeUserDuplicate
- OnBeforeUserFormDelete
- OnBeforeUserFormSave
- OnUserActivate
- OnUserBeforeRemove
- OnUserBeforeSave
- OnUserChangePassword
- OnUserDeactivate
- OnUserDuplicate
- OnUserFormDelete
- OnUserFormPrerender
- OnUserFormRender
- OnUserFormSave
- OnUserNotFound
- OnUserRemove
- OnUserSave
Custom Events¶
No GUI exists for custom events yet — create them through the API. Events have these attributes:
| Attribute | Description |
|---|---|
| name | The unique event name. |
| service | A loose grouping of events by area. Services 1, 2, 4, 5 and 6 load inside the Manager; services 1, 3, 4, 5 and 6 load outside it (see getEventMap()). |
| groupname | Groups the events visually in the MODX Manager, where it appears as a Plugin tab. |
Create an event through the MODX API:
$Event = $modx->newObject('modEvent');
$Event->set('name', 'OnMyCustomEvent');
$Event->set('service',1);
$Event->set('groupname', 'Custom');
Fire the event by name:
$modx->invokeEvent('OnMyCustomEvent', $options);
Then register a Plugin for the event. It receives the options passed to invokeEvent().
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










