Hello in an attempt do to do some text replacement on the HTML of a fully rendered document before it is outputted to the browser I encountered a problem.
I prefer to do this with a plugin, and I know that it is possible to use
$modx->event->name == 'OnParseDocument'
&$this->modx->resource->_content;
However this will trigger my plugin code to run for every resource attached to the document. Which I presume can be avoided, I tried various other events like ’OnWebPagePrerender’ but do not know how to reference the fully generated HTML code.
Any suggestions? Much appreciated!