Skip to content

Instantly share code, notes, and snippets.

@sonicpunk
Created May 29, 2013 13:20
Show Gist options
  • Save sonicpunk/5670209 to your computer and use it in GitHub Desktop.
Save sonicpunk/5670209 to your computer and use it in GitHub Desktop.
MODX Snippet. According to the given template ID you can include or exclude a specific HTML chunk.
//[[checkTemplate? &templateID=`1` &tpl=`bxsliderjs`]]
<?php
$output='';
$template=$modx->resource->get('template');
if($exclude!=1){
if($template==$templateID){
$output.=$modx->getChunk($tpl);
};
} else if($exclude==1){
if($template!=$templateID){
$output.=$modx->getChunk($tpl);
};
}
return $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment