Hello all.
I need to have new documents inherit their parent’s content type. I’ve tried doing a simple hack to the Inherit Parent Template, but I can’t get it to do anything. Any suggestions? I think the issue is with the ’getPageInfo’ function, but I’m not sure. Here’s what I have (which simply has ’template’ replaced with ’contentType’):
global $content;
$e = &$modx->Event;
switch($e->name) {
case 'OnDocFormPrerender':
if(($_REQUEST['pid'] > 0) && ($id == 0)) {
if($parent = $modx->getPageInfo($_REQUEST['pid'],0,'contentType')) {
$content['contentType'] = $parent['contentType'];
}
}
break;
default:
return;
break;
}
Thanks for any help.
-Brett