you can try to load your content in a new chunk-object and process that chunk:
<?php
// [[Get_HTML? &id=`1`]]
$content = '';
$holder = $modx->getObject('modResource', array('id' => $id) );
$chunk = $modx->newObject('modChunk');
$chunk->setContent($holder->get('content'));
$chunk->setCacheable(false);
$content=$chunk->process();
// the third argument is a literal newline (I just hit enter/return)
$find = array('<', '>', '
', ' ');
$replace = array('<', '>', '<br />', ' ');
$content = str_replace($find, $replace, $content);
return $content;
or try something like this:
<?php
// [[Get_HTML? &id=`1`]]
$content = '';
$holder = $modx->getObject('modResource', array('id' => $id) );
$holder->set('cacheable',false);
$holder->set('_processed',false);
$holder->set('_content',false);
$holder->set('template',0);//this was the line which changed something.
//echo $holder->get('id');
$content=$holder->process();
// the third argument is a literal newline (I just hit enter/return)
$find = array('<', '>', '
', ' ');
$replace = array('<', '>', '<br />', ' ');
$content = str_replace($find, $replace, $content);
return $content;
or try file_get_contents
<?php
// [[Get_HTML? &id=`1`]]
$content = '';
/*
$holder = $modx->getObject('modResource', array('id' => $id) );
$chunk = $modx->newObject('modChunk');
$chunk->setContent($holder->get('content'));
$chunk->setCacheable(false);
$content=$chunk->process();
*/
/*
$holder = $modx->getObject('modResource', array('id' => $id) );
$holder->set('template',0);//this was the line which changed something.
//echo $holder->get('id');
$content=$holder->process();
*/
$content = file_get_contents($modx->makeUrl($id,null,null,'full'));
// the third argument is a literal newline (I just hit enter/return)
$find = array('<', '>', '
', ' ');
$replace = array('<', '>', '<br />', ' ');
$content = str_replace($find, $replace, $content);
return $content;