Jump to main content Jump to doc navigation

Event: OnWebPagePrerender

Fires after a Resource is parsed, before it is rendered. Content-Type headers are not sent yet and the output is not flushed.

  • Service: 5 - Template Service Events
  • Group: System

Event Parameters

None.

Example

Filter words from the output before it is displayed:

$words = array("snippet", "template"); // words to filter
$output = &$modx->resource->_output; // get a reference to the output
$output = str_replace($words,"<b>[filtered]</b>",$output);

Static Plugins and relative paths. If the Plugin is a static element and includes or requires files by relative paths, it does not run from the original file. Its code executes from the cached copy — for example core/cache/includes/elements/modplugin/7.include.cache.php. See Bug 11129.

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

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • CrewMark
  • Fabian Christen
  • Sepia River Studios
  • Dannevang Digital
  • Alex
  • A. Moreno
  • Chris Fickling
  • Stéphane Jäggi
  • Murray Wood
  • Anton Tarasov
  • JT Skaggs
  • deJaya
  • Lefthandmedia
  • eydolan
  • Following Sea
  • Guido Gallenkamp
  • YJ
  • Raffy
  • Snow Creative
  • Nick Clark
  • Guest
  • Helen
  • krisznet
  • Yanni
  • Richard

Budget

$194 per month—let's make that $500!

Learn more