Fb:container

From Facebook Developer Wiki

Jump to: navigation, search

Contents

Description

This tag is used as a container for other markup. Typically, you use this tag only if you are using the condition attribute to control visibility of markup within the tag. You shouldn't use this to implement any sort of privacy over the content inside this tag, as the user can see the content by viewing the page source.

Note: The root HTML markup that contains the content that should be a <span> tag. For example:

<fb:container> <span> … </span> </fb:container>

Attributes

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

Examples

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

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