Name

<fb:if-is-group-member/>

Synopsis

<fb:if-is-group-member>...<fb:else>...</fb:else></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.

FBML-Specific Attributes

Required

gid=[int]

The group ID used to verify whether a user is part of that group.

Optional

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.

Example FBML

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>

Rendered HTML for Single Instance of Tag

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!

Additional Information

  • This tag supports <fb:else/>.

  • This tag may be used only on a user’s canvas page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.34.62