<?php
echo $modx->documentObject['content'];
$modx->runSnippet('AjaxSearch');
?>
If there’s a better solution, please post it.<?php
echo $modx->documentObject['content'];
echo $modx->runSnippet('AjaxSearch');
?>Hmm, I put an echo in front and now it works. I didn’t think that was necessary.You need to use ’echo’ or capture the output into a variable and use ’return’ to output it to the page. The runSnippet() method always returns the string output of the snippet being called so it’s up to you to process the output.
Try something like this:
Hmm, I put an echo in front and now it works. I didn’t think that was necessary.If there’s a better solution, please post it.
<?php
$output = '<pre>';
$output .= $modx->documentObject['content'] . "\n";
$output .= $modx->runSnippet('AjaxSearch');
$output .= '</pre>';
return $output;
?>No, was just exemplifying how to store the content into a string.
Excellent, thanks! I’m curious though, was there any specific reason for the <pre> tags?