We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    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
      Need MODx Ecommerce? Try FoxyCart!
      • 8960
      • 150 Posts
      Would the code Hald pasted here help you?