We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1240
    • 43 Posts
    Hello !

    I’m trying to use plugins but I have no reaction on MODx 0.9.5.
    This is my plugin’s code :

    <?php
    $e = &$modx->Event;
    switch ($e->name) {
        case "OnWebPagePrerender":
            $o = $modx->documentOutput;
            $o = str_replace("essai","plouf",$o);
            $modx->documentOutput = $o;
            break;
        default :
            return; // stop here - this is very important.
            break;
    }
    ?>


    In my exemple, I want to replace the "essai" occurances by "plouf" before the sending of the page. I have checked the "OnWebPagePrerender" event but nothing append. No correction on the page and no error message.

    Help embarrassed wink