We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29902
    • 72 Posts
    This is a plugin that I use for my templates to inherit their parents template:

    Plugin-name: InheritParentTemplate

    Plugin-code:
    <?php
    if ($modx->event->name == 'OnDocFormRender' && $mode == modSystemEvent::MODE_NEW) {
      $parent_id = $modx->getOption('parent', $_REQUEST, 0);
      if ($parent_id) {
        $parent = $modx->getObject('modResource', $parent_id);
        if ($parent) {
          $template_id = $parent->get('template');
          if (isset($modx->controller)) {
    	$modx->controller->setProperty('template', $template_id);
          } else { // modX < 2.2.0
    	$_REQUEST['template'] = $template_id;
          }
        }
      }
    }


    System Events: OnDocFormRender
      ...I believed it was Friday...