MODx Chunk Cache Plugin
Oct
22
22
I needed to cache a chunk as a file so that another application (an ecommerce store) could include that file as well. I wrote this plugin that does that:
PHP:
-
foreach($chunks as $v)
-
{
-
$res = $modx->db->select("snippet","modx_site_htmlsnippets","name = '$v'");
-
if($modx->db->getRecordCount($res))
-
{
-
$output = $modx->db->getValue($res);
-
}
-
}
Configure this chunk to have the OnChunkFormSave system event an whenever a chunk is saved it will write the specified chunks to the file system.
Related Posts

No comments yet.