October 2008
Intermediate to advanced
434 pages
12h 7m
English
How do I display content only to members of a specific group?
Use the fb:if-is-group-member
tag and specify the group ID. The simplest form is:
<fb:if-is-group-member gid="12345">Private content goes here</fb:if-is-group-member>
You can use this tag in combination with the fb:else tag to display alternate content to people who aren’t in
the group. The tag will default to checking for the loggedinuser, but you
can also specify a different uid if
you want to check a different member:
<fb:if-is-group-member gid="12345" uid="12345">
Private content goes here
<fb:else>
Sorry! You're not in <fb:grouplink gid="12345"/>.
</fb:else>
</fb:if-is-group-member>Since groups support different roles (member, admin, officer),
you can also use the fb:if-is-group-member to check for a user’s access level:
<fb:if-is-group-member gid="12345" uid="12345" role="admin">
Private content for admins goes here
<fb:else>
Sorry! You're not an admin of <fb:grouplink gid="12345"/>.
</fb:else>
</fb:if-is-group-member>Read now
Unlock full access