We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    in a plugin when use OnParseDocument the outout repeat ten times,
    the code i use is this
    $e = $modx->Event;
    switch ($e->name) {
    case "OnParseDocument":
    $a =$modx->insideManager();
    if ($_SESSION[’mgrInternalKey’]!=999999999999) {
    $html="hello";
    $content = $modx->documentOutput ;
    $modx->documentOutput = $content.$html;
    }else{}
    break;
    default :
    return; // stop here - this is very important.
    break;
    }
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 32963
      • 1,732 Posts
      Is it that "hello" is repeated ten times?
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 19726
        • 239 Posts
        This is probably because your plugin is executed 10 times. 10 is also the maximum amount of parser passes. To verify this theory try changing the $modx->maxParserPasses at the bottom of your index.php file and see if the amount changes accordingly.