resource->getOne('Template')->getProperties(); if(!empty($properties['tpl'])){ $tpl = $properties['tpl']; } else{ $tpl = 'post.tpl'; } if ($modx->resource->cacheable != '1') { $modx->smarty->caching = false; } if(!empty($properties['phptemplates.non-cached'])){ $modx->smarty->compile_check = false; $modx->smarty->force_compile = true; } return preg_replace("/[ \n\t\r]+$/sm", "\r", $modx->smarty->fetch("tpl/{$tpl}"));