didn’t test it but you can try to edit inherit-parent-template-plugin like that:
/*
* Written By Raymond Irving - 12 Oct 2006
*
* Simply results in new documents inherriting the template
* of their parent folder upon creating a new document
*
* Configuration:
* check the OnDocFormPrerender event
*
* Version 1.0
*
*/
global $content;
$e = &$modx->Event;
$tvname='childTemplate';
switch($e->name) {
case 'OnDocFormPrerender':
if(($_REQUEST['pid'] > 0) && ($id == 0)) {
if($parent = $modx->getPageInfo($_REQUEST['pid'],0,'template')) {
$tv=$modx->getTemplateVarOutput($tvname,$_REQUEST['pid']);
$content['template'] = !empty($tv[$tvname])?$tv[$tvname]: $parent['template'];
}
}
break;
default:
return;
break;
}
have a TV in your parent resource named childTemplate which holds the templateID for its childs.
why not just:
@SELECT templatename,id FROM `modx_site_templates`