I couldn't make it work either and I also couldn't get it to work with the If snippet.
This worked:
[[!GroupMember? &groups=`Administrator,group1` &yes=`Is a Member` &no=`Not a member`]]
/* GroupMember snippet */
$groups = explode(',', $scriptProperties['groups']);
if ($modx->user->isMember($groups) ) {
return $scriptProperties['yes'];
} else {
return $scriptProperties['no'];
}
Note: The &groups property could be &groups=`Group1` and you could modify the snippet so that the &yes and &no properties contained the names of chunks to show:
if ($modx->user->isMember($groups) ) {
return $modx->getChunk($scriptProperties['yes']);
} else {
return $modx->getChunk($scriptProperties['no']);
}
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: BobRay last edited this post 14 years, 7 months ago.]