Built a few aites in Modx, but was wondering...
Is there any way to use external files as templates, as opposed to using the database? That’s one of the things I actually like about Wordpress and a couple other CMS’s... you can change the code in something like coda as opposed to doing it in the CMS...
Thanks in advance.
Chris
I don’t remember who actually originally provided this code, but it was here on the forums.
<?php
# Snippet to include template files from file system
# USAGE: [[includeTemplate? &tpl=`mytemplate/template.html`]]
if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
$tpl = $base_path .'assets/templates/'.$tpl;
ob_start();
include($tpl);
return ob_get_clean();
?>