Name

<fb:else/>

Synopsis

<fb:else>...</fb:else>

Renders the content within the tags only if the condition specified in the containing tags is false. It is compatible within any type of <fb:if*/> tag or the <fb:is-in-network/> tag, as well as within the <fb:is-it-april-fools/>, <fb:is-it-christmas/>, <fb:18-plus/>, and <fb:21-plus/> tags.

FBML-Specific Attributes

Required

None.

Optional

None.

Example FBML

Here is example FBML code for <fb:else/>:

<fb:if value="true"> Display content here only if value="true".
    <fb:else> If fb:if's value were "false", then this would 
    be displayed. </fb:else> </fb:if>

Here is a second example:

<fb:if-is-user uid="1,2,3"> Display content here only if the 
    user has id 1,2,3. <fb:else> If uid is 4, 10, or anything 
    but 1,2,3, display this content. </fb:else> </fb:if>

Rendered HTML for Single Instance of Tag

In the first example, because value="true", the rendered HTML will always look like this:

Display content here only if value="true".

In the second example, if the user ID is 1, 2, or 3, the rendered HTML will look like this:

Display content here only if the user has id 1,2,3.

In the second example, if the user ID is not 1, 2, or 3, the rendered HTML will look like this:

If uid is 4, 10, or anything but 1,2,3, display this content.

Additional Information

  • <fb:else/> is compatible within the following tags:

    <fb:if/>
    <fb:if-can-see/>
    <fb:if-can-see-photo/>
    <fb:if-is-app-user/>
    <fb:if-is-friends-with-viewer/>
    <fb:if-is-group-member/>
    <fb:if-is-own-profile/>
    <fb:if-is-user/>
    <fb:if-user-has-added-app/> ...

Get FBML Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.