if ($modx->getCacheManager() && $cache = $modx->cacheManager->get($cacheKey)) {
$sort = $modx->getOption('sort',$scriptProperties,'rank'); if ($modx->getCacheManager() && $sort != 'rand' && $cache = $modx->cacheManager->get($cacheKey)) {