-
-
Save andronex/6691ca9dfaa6e91e36672acaaf67f197 to your computer and use it in GitHub Desktop.
Plugin for setup template by parent resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $modx->event->name == 'OnDocFormRender' && $mode == modSystemEvent::MODE_NEW ) { | |
$template = $modx->runSnippet( 'pdoField', array( | |
"id" => $_REQUEST['parent'] | |
, "field" => "template" | |
, "top" => 0 | |
) ); | |
switch ( $template ) { | |
case 1: | |
$template = 2; | |
break; | |
default: | |
$template = 1; | |
break; | |
} | |
$modx->controller->setProperty( 'template', $template ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment