Since I already have some responses on this post, I’m going to add one more question that falls in line with the previous ones. Because I have to call the snippet cached, changes to the DB table aren’t showing up unless I clear the site cache. I’ve figured out how to do this automatically in my snippet, like so:
function clearCache() {
include_once "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath("assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
}
clearCache($sync);
However, I don’t want this to fire all the time -- only when the placeholder is present on the page. Can I check this somehow and write it into an if statement? I thought the getPlaceholder API function would work, but it doesn’t do quite what I thought it did.