<fb:if-is-group-member/>
Content within this tag renders only if the user is a member of a specified group. This tag can also be used to determine whether a particular user is an admin or an officer in a specified group.
uid=[int
] default:
profileowner
The ID of the user you want to verify as a
member of the group with the specified
gid
.
role=[member|officer|admin]
default: member
If you want to verify whether a user actually
has a particular role within a group, use something other
than member
here. If
officer
is specified, and a
gid
is specified, the logged-in user must
be an officer in the specified group in order for the
content to render.
Here is example FBML code for
<fb:is-group-member/>
:
<fb:if-is-group-member gid="1234567890"> Congrats! You belong to the group specified! <fb:else> Sorry - you don't belong to the group specified </fb:else> </fb:if-is-app-user>
Here is a second example:
<fb:if-is-group-member gid="1234567890" role="admin"> The logged in user is an admin of this group. <fb:else> Sorry - you're not an admin of this group! </fb:else> </fb:if-is-group-member>
For the first example, if the current user is part of the group with an ID of 1234567890, the rendered HTML looks like this:
Congrats! You belong to the group specified!
For the first example, if the current user is not part of the group with an ID of 1234567890, the rendered HTML looks like this:
Sorry - you don't belong to the group specified
For the second example, if the current user is an admin of the group with an ID of 1234567890, the rendered HTML looks like this:
The logged in user is an admin of this group.
For the second example, if the current user is not an admin of the group with an ID of 1234567890, the rendered HTML looks like this:
Sorry - you're not an admin of this group!
18.219.34.62