Return to Snippet

Revision: 20415
at November 15, 2009 11:57 by warrenonline


Initial Code
<?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();
?>

Initial URL
http://warrenonline.ca

Initial Description
Code to include template files in MODx. This way files can be edited in Dreamweaver or other editor without cutting and pasting into the Manager all the time.

Initial Title
MODx Include Template

Initial Tags

                                

Initial Language
PHP