Skip to content

Instantly share code, notes, and snippets.

@jonleverrier
Last active June 2, 2016 13:50
Show Gist options
  • Save jonleverrier/30d1130bf9dda129c524d8ebed563616 to your computer and use it in GitHub Desktop.
Save jonleverrier/30d1130bf9dda129c524d8ebed563616 to your computer and use it in GitHub Desktop.
MODX: List all context keys but exclude the manager
<?php
$contexts = $modx->getCollection('modContext', array('key:!=' => 'mgr'));
foreach($contexts as $context)
{
$context_keys[] = $context->get('key');
}
return implode(',', $context_keys);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment