Working on a MODx Revo based site and trying to write a simlpe plugin (inspired by 'template switcher plugin written in the past for Evo). Below is the code
if (isset($_GET['template'])) {
$template_id=$_GET['template'];
if(isset($template_id)){
$template = $modx->getObject('modTemplate', $template_id);
$modx->resource->template = $template->get('id');
}
}
Eventually the plugin will include much more checks etc, however for now I just want to make sure it works. Idea is simple, it's supposed to get different template for a page based on template param provided with the url. And the problem that prevents it from working as I want it to is modx caching.
My question is, how can I manipulate cache (clear/reload?) on this particular scenario so the plugin does its job?