Created
May 29, 2013 13:16
-
-
Save sonicpunk/5670180 to your computer and use it in GitHub Desktop.
MODX Snippet. Decide which HTML chunk to output based on what template ID you are looking for.
This file contains hidden or 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
//Snippet Call [[ifElseTemplate? &ifId=`1` &ifTpl=`kontakt_info` &elseId=`4` &elseTpl=`kontakt_person_info`]] | |
<?php | |
$output=''; | |
$template=$modx->resource->get('template'); | |
if($template==$ifId){ | |
$output.=$modx->getChunk($ifTpl); | |
}else if($template==$elseId){ | |
$output.=$modx->getChunk($elseTpl); | |
}; | |
return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment