-
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.
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.
you can try to add this to your script:
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);
}
Thanks, Bruno. That did the trick!
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.