We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 727
    • 502 Posts
    Quote from: BobRay at Jan 26, 2010, 12:37 PM

    That said, you may find the functions you need in the document parser (although you may want to call getDocumentObject() rather than getDocument()).

    manager/includes/document.parser.inc.php

    Yes, I went through the document parser source code and couldn’t find what I needed. Perhaps I am stupid. Thanks for suggesting it though.

    Andy
      • 22303 MODX Staff
      • 10,725 Posts
      getDocumentObject is an internal function and not to be called in ANY components or other code. There is no real way to process an entire document outside of the Evo parser, without implementing the flow of the entire Evo parser.

      In Revo however, you can simply get a modResource object and call the process() method on it to produce the output. This is one of the major reasons for the Revo rewrite.
        • 27733
        • 99 Posts
        Along these lines, what would be the best way to capture a parsed page (given an id) into a variable from within the manager? I’m working on an email marketing module that will convert a given modx document into a valid multi-part email message. I did try the above method of setting the $_REQUEST[’id’] to the id of a document and executing the parser. It works, however, because I’m operating within the manager, I’m getting all the extra output from the QM plugin in the source. Is there any way to get the un-altered source without disabling QM beforehand? Thanks for any pointers!
          ------
          Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
          • 4172
          • 5,888 Posts
          you can try to add this to your script:
          $GLOBALS['stopQM']='1';


          and modify QM:
          if (!isset($GLOBALS['stopQM'])){
          include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
          $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq, $loadtb, $usemm, $tbwidth, $tbheight, $hidefields, $addbutton, $tpltype, $tplid);
          }
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 27733
            • 99 Posts
            Thanks, Bruno. That did the trick!
              ------
              Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.