Posted By

warrenonline on 11/15/09


Tagged

modx


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

crunch


MODx Include Template


 / Published in: PHP
 

URL: http://warrenonline.ca

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.

  1. <?php
  2. # Snippet to include template files from file system
  3. # USAGE: [[includeTemplate? &tpl=`mytemplate/template.html`]]
  4.  
  5. if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
  6.  
  7. $tpl = $base_path .'assets/templates/'.$tpl;
  8. include($tpl);
  9. return ob_get_clean();
  10. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: warrenonline on November 15, 2009

Not written by me. Just saved and shared here.

You need to login to post a comment.