<?php
global $content;
$e = &$modx->Event;
$containers = array(1,2,3); // container IDs for custom template
$custom_tpl = 12; //custom template ID
switch($e->name) {
case 'OnDocFormPrerender':
if(($_REQUEST['pid'] > 0) && ($id == 0)) {
if(in_array($_REQUEST['pid'], $containers)) {
$content['template'] = $custom_tpl;
}
elseif ($parent = $modx->getPageInfo($_REQUEST['pid'],0,'template')) {
$content['template'] = $parent['template'];
}
}
break;
default:
return;
break;
}
?>
.That works well for me. but my clients don’t like it. I have also created a "template’ document and added a link on the manager home to duplicate this document. this is also a good solution and works well for clients.
The easiest thing is to just create a new blog-entry by way of duplicating an existing doc. In the manager tree, do mouse-right-click and select "duplicate this page". The template should be the same as the source-doc, not its container.