MODX Events
Last updated Jan 31st, 2020 | 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
$287 per month—let's make that $500!
Learn moreFredBeforeRender¶
This event is triggered only on the frontend before Fred is initiated and is used to inject custom plugins to Fred or to load custom JS/CSS files.
No parameters are passed to this event, but it expects the output (assigned to $modx->event->_output
) to be in this format:
includes¶
String of HTML markup that will get appended after Fred's CSS & JS file includes.
Example¶
beforeRender¶
String of JS commands that will get added to Fred's beforeRender
function. Could be used to register Fred plugins.
Example¶
lexicons¶
An array of additional lexicons that Fred should load.
Example¶
modifyPermissions¶
String of JS commands that will get added to Fred's modifyPermissions
function where permissions
parameter is available as an object of all available permissions for the current user.
Example¶
FredOnBeforeFredResourceSave¶
This event is triggered before Fred Resource is saved either from manager or from web. Properties:
- id (ID of the Resource that's going to be saved)
- resource (modResource object)
FredOnFredResourceSave¶
This event is triggered after the Fred Resource is saved either from manager or from web. Properties:
- id (ID of the Resource that's going to be saved)
- resource (modResource object)
FredOnFredResourceLoad¶
This event is triggered before the frontend LoadContent endpoint returns data to the browser. Properties:
- id (ID of the currently loading Resource)
- resource (modResource object)
- data (Data that will be returned by the endpoint in a form of stdClass)
FredElementFormRender¶
@todo
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
$287 per month—let's make that $500!
Learn more