That’s very mysterious.
You put the snippet tag in the Content section of the page, I assume. Is there a [[*content]] tag in the template used by that page?
Try this version:
<?php
/* UserGroups snippet*/
if ($modx->user->isMember(’membres’) ) {
$output = $modx->getChunk(’membres’);
} elseif ($modx->user->isMember(’administrateurs’) ) {
$output = $modx->getChunk(’administrateurs’);
} elseif ($modx->user->isMember(’employés’) ) {
$output = $modx->getChunk(’employés’);
} else {
$output = $modx->getChunk(’offline’);
}
return $output;
Did you check the modx error log?
It’s easy to make a typo with a ";" or a "$".
Snippets are notoriously difficult to debug...
If my snippets get too long, I export them from modx to an external file which I can edit/debug with NetBeans. The snippet then only contains an include to the external file. Of course once the snippet is debugged and tested, you can always copy it back into modx.
MODx Revolution / MAMP / OS X