Fb:serverfbml

From Facebook Developer Wiki

Revision as of 18:34, 24 February 2009 by Pete Bratach (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

Description

Renders the FBML on a Facebook server inside an iframe. You must use this tag to render elements on Facebook like fb:request-form and fb:connect-form (for friend selectors). The tags that don't need to be used with fb:serverfbml are listed on the XFBML page.

This container tag holds display/FBML elements that must be served in a Facebook iframe for security reasons. For instance, the fb:request-form tag must be wrapped inside this tag in order to work on a Facebook Connect site, since we need to be able to verify that the user performed the actions on the form.

Attributes

RequiredNameTypeDescription
optional condition string Indicates whether the button is visible or hidden. See the Notes below for further explanation.

Examples

<fb:serverfbml style="width: 755px;"> <script type="text/fbml"> <fb:fbml> <fb:request-form action="<url for post invite action, see wiki page for fb:request-form for details>" method="POST" invite="true" type="XFBML" content="This is a test invitation from XFBML test app <fb:req-choice url='see wiki page for fb:req-choice for details' label='Ignore the Connect test app!' /> " > <fb:multi-friend-selector showborder="false" actiontext="Invite your friends to use Connect."> </fb:request-form> </fb:fbml> </script> </fb:serverfbml>

Notes

Using the condition Attribute

All XFBML tags support the condition attribute. This attribute determines whether an XFBML element is visible or hidden. When condition is absent, the element is visible by default. The value of condition should be a string containing some JavaScript code. The JavaScript should be evaluated into either a boolean or an FB.Waitable object whose result field is a boolean. The FB.Waitable object is designed to allow asynchronous evaluation. For example, if you want to specify an element should be visible only if the current users can see the profile of another user, you can use this markup:

<fb:container condition="FB.XFBML.Conditions.ifCanSee('1160', 'profile')"> <span>This text should be visible only if I can see the profile of user 1160.</span> </fb:container>


The following are some pre-built condition objects.

reference