OnChunkFormPrerender
Last updated Apr 12th, 2019 | 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 moreEvent: OnChunkFormPrerender¶
Fires before the Chunk form is rendered in the Manager. The controller has loaded its custom CSS/JS (loadCustomCssJs()); the page CSS/JS is not registered yet (registerCssJs()). Use it to render custom JavaScript in the mgr Context.
- Service: 1 - Parser Service Events
- Group: Chunks
Event Parameters¶
| Name | Description |
|---|---|
| mode | Either new or upd (modSystemEvent::MODE_NEW / MODE_UPD). |
| id | The ID of the Chunk. This will be 0 for new Chunks. |
| chunk | A reference to the modChunk object. null for new Chunks. |
Example¶
<?php
$eventName = $modx->event->name;
switch($eventName) {
case 'OnChunkFormPrerender':
$modx->regClientStartupHTMLBlock('
<style>
.x-form-text {color: #ff0000;}
</style>');
break;
}
See Also¶
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










