In Evolution CMS (former MODx Evolution) I have some scenarios where I use a snippet to go through the document content using the DOM in PHP.
The document content contains HTML and several snippets. Those snippets generate custom HTML output (when rendering for frontend).
Now I need this final HTML output (inside the executing snippet) when using the DOM.
If I do it with my snippet, the output of the other snippets is not processed, i. e. I get:
<p>...</p> [[snippetx]]
instead of
<p>...</p> <p>Nice snippet output. We calculated 12.</p>
.
I have tried the following code without success where I try to execute the rendering:
// public function renderDoc($id, $events = false, $tpl = null)
$docid = 123;
$events = false;
$tmplid = 1;
$output = $modx->renderDoc($docid, true, $tmplid);
return $output;
This returns NULL
in EVO 1.4.
I have updated to EVO2. Now there is the error message:
Error : The EvolutionCMSCore::renderDoc() method is undefined
Seems there is another method for rendering the content now.
So how to parse the content first to HTML to process it safely afterwards with the snippet?
question from:
https://stackoverflow.com/questions/65602321/how-to-parse-the-document-content-and-then-process-the-final-html-within-a-snipp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…