MODx Include Template


/ Published in: PHP
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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. ?>

URL: http://warrenonline.ca

Report this snippet


Comments


You need to login to view comments.