facebook FBML Reference Guide Consolidated by: yapish.
facebook FBML Reference Guide Page 2 of 159 Table of Contents Table of Contents...................................................................................................................................................2 FBML......................................................................................................................................................................5 From Facebook Developers Wiki.................................................................................
facebook FBML Reference Guide Page 3 of 159 Fb:flv.............................................................................................................................................................47 Fb:silverlight.................................................................................................................................................48 Tools ....................................................................................................................................
facebook FBML Reference Guide Page 4 of 159 Fb:editor-buttonset......................................................................................................................................111 Fb:editor-cancel..........................................................................................................................................112 Fb:editor-custom.......................................................................................................................................
facebook FBML Reference Guide Page 5 of 159 FBML From Facebook Developers Wiki Jump to: navigation, search Facebook Markup Language (FBML) enables you to build full Facebook Platform applications that deeply integrate into a user's Facebook experience. You can hook into several Facebook integration points, including the profile, profile actions, Facebook canvas, News Feed and Mini-Feed.
facebook FBML Reference Guide Page 6 of 159 Facebook tags Summary: User/Groups Deprecated Tags Profile-specific Visibility on Profile Embedded media Tools Misc Forms Message/Wall attachments Notifications and requests Status messages Editor display Page navigation Dialog Wall User/Groups Fb:name Description Renders the name of the user specified, optionally linked to his or her profile. This also works for Facebook Pages with the ID of the Page passed as the uid parameter.
facebook FBML Reference Guide Page 7 of 159 possessive bool Make the user's name possessive (e.g. Joe's instead of Joe). (default value is false) reflexive bool Use "yourself" if useyou is true. (default value is false) shownetwork bool Displays the primary network for the uid. (default value is false) useyou bool Use "you" if uid matches the logged in user. (default value is true) ifcantsee string Alternate text to display if the logged in user cannot access the user specified.
facebook FBML Reference Guide Page 8 of 159 Fb:user Description Forces the enclosed content to be restrained to site privacy checks[verify] based on the viewer of the information. The content within the tag "belongs" to the user specified. Note: This tag does not appear to work at all when I test it, it does nothing. See bug report number 404. Attributes Required Name Type Description required uid int The user ID of the user whose information will be contained in the tag.
facebook FBML Reference Guide Page 9 of 159 Fb:pronoun Description Renders a pronoun for a specific user. Attributes Required Name Type Description required uid int The user ID for whom to generate the pronoun. You can substitute actor for the user ID so you can more easily aggregate feed stories. optional useyou bool Use the word "you" if uid is viewing the page. (default value is true) possessive bool Use the possessive form (his/her/your/their).
facebook FBML Reference Guide Page 10 of 159 Fb:profile-pic Description Turns into an img tag for the specified user's or Facebook Page's profile picture. The tag itself is treated like a standard img tag, so attributes valid for img are valid with fb:profile-pic as well. Attributes Required Name Type Description required uid int The user ID of the profile or Facebook Page for the picture you want to display. optional size string The size of the image to display. (Default value is thumb).
facebook FBML Reference Guide Page 11 of 159 Fb:eventlink Description Prints the specified event name and formats it as a link to the event's page. Attributes Required Name Type Description required eid int Event ID for the event whose name and link you want to retrieve. Examples www.yapish.
facebook FBML Reference Guide Page 12 of 159 Fb:grouplink Description Prints the specified group name and formats it as a link to the group's page. Attributes Required Name Type Description required gid int Group ID for the group whose name and link you want to retrieve. Examples www.yapish.
facebook FBML Reference Guide Page 13 of 159 Fb:networklink Description Prints the specified network name and formats it as a link to the network's page. Attributes Required Name Type required nid int Description Network ID for the network whose name and link you want to retrieve. Examples www.yapish.
facebook FBML Reference Guide Page 14 of 159 Fb:is-in-network Description Displays content inside the tag only if the user is in a given network. Note: You can use fb:else with fb:is-in-network, even though the tag does not start with fb:if-. Attributes Required Name Type Description required network int The network ID to check. You can check one network at a time. optional uid int The user ID to check.
facebook FBML Reference Guide Page 15 of 159 Fb:if-can-see Description Displays the enclosed content if the logged in user can see the specified what attribute of the specified user. You can use these settings to provide content or links with relevance to Facebook privacy or to implement your own privacy using Facebook's current controls. You can use this tag in conjunction with fb:else. Attributes Required Name Type Description required uid int The user ID to check.
facebook FBML Reference Guide Page 16 of 159 Fb:if-can-see-photo Description Displays the enclosed content only if the logged in user can see the photo specified. You should use this tag[who says?] when specifying content that should only be shown when using fb:photo. You can use this tag in conjunction with fb:else. Attributes Required Name Type Description required pid int An API-supplied pid of the photo, or any pid found in the query string of a photo URL on Facebook.
facebook FBML Reference Guide Page 17 of 159 Fb:if-is-app-user Description Displays the enclosed content only if the specified user has accepted the terms of service of the application. Use to determine whether the user has added the application to their account. Attributes Required Name Type Description optional uid int The user ID to check.
facebook FBML Reference Guide Page 18 of 159 Fb:if-is-friends-with-viewer Description Displays the enclosed content only if the specified user is friends with the logged in user. Attributes Required Name Type Description optional int uid includeself bool The user ID to check. (default value is profile owner[verify]) Return true if viewer and uid specified are the same.
facebook FBML Reference Guide Page 19 of 159 Fb:if-is-group-member Description Displays the enclosed content only if the specified user is a member of the specified group. Attributes Required Name Type Description required gid int The group ID. optional uid int The user ID to check. (default value is loggedinuser) role string The role to check. (Default value is member). Other valid values are officer, admin.
facebook FBML Reference Guide Page 20 of 159 Fb:if-is-user Description Only renders the content inside the tag if the viewer is one of the specified user(s). Attributes Required Name Type Description required uid int The user ID of the user that is allowed to see the content. To match multiple users, pass in a comma-delimited list of uids. Examples This is secret 4 u 2! Notes As of FBML v1.1 you can use this tag only on a canvas page. www.yapish.
facebook FBML Reference Guide Page 21 of 159 Fb:if-user-has-added-app Description Displays the enclosed content only if the specified user has added the application to their account. Attributes Required Name Type Description optional uid int The user ID to check. (default value is loggedinuser) Examples This user has put this app into his account. That user hasn't put this app into his account.
facebook FBML Reference Guide Page 22 of 159 Deprecated Tags Fb:userlink Description Prints the specified user's full name linked to their profile along with their network, optionally (as is normally displayed on the Wall, for example). This tag is deprecated. It is still useful in one context, however: using it in feed.publishActionOfUser (with the user ID on whose behalf the action is being published) prevents the Mini-Feed from prepending the actor's name to your feed title.
facebook FBML Reference Guide Page 23 of 159 Fb:if-is-own-profile Description This tag is deprecated, since if- tags are no longer allowed on profile pages. It was used to display content inside only if the viewer of the profile matches the profile owner.[verify] See also/instead fb:visible-to-user Attributes Examples Welcome back to your profile! This is not your profile. Notes As of FBML v1.1 you can use this tag only on a canvas page.
facebook FBML Reference Guide Page 24 of 159 Profile-specific Fb:wide Description The enclosed content appears only when profile box is in the wide column of the profile. See fb:narrow for the opposite. Attributes Examples This will only appear in the wide column. Notes If no fb:narrow or fb:wide tag is specified, all content appears in either column. The wide profile box is 388 pixels wide, not including margins. The left margin is 8 pixels, but there is no right margin.
facebook FBML Reference Guide Page 25 of 159 Fb:narrow Description Renders the content contained by the tag only if the profile box is in the narrow column of the profile. Attributes Examples This text appears only in the narrow column. Notes If no fb:narrow or fb:wide tag is specified, all content is displayed in either column. The narrow profile box is 190 pixels wide, not including margins. The left margin is 10 pixels, but there is no right margin.
facebook FBML Reference Guide Page 26 of 159 Fb:profile-action Description Renders a link on the user's profile under their photo (such as "View More photos of.."). Attributes Required Name Type Description required url string The URL to which the user is taken after clicking. Must be an absolute link. Examples PAGE 27facebook FBML Reference Guide Page 27 of 159 Check Out Application
Notes Use profile.setFBML to add the button to a user's profile. If you add this to the profile of a user who has not added your application, it will appear only to those users who have added your application. By setting the default FBML (in Edit Settings, under My Applications) to include an fb:profile-action, this action appears on every profile the user of your application sees.
facebook FBML Reference Guide Page 28 of 159 Fb:user-table Description Renders a table, each cell of which contains a thumbnail and name for a particular user, similar to the Mutual Friends table on profile pages. Inside this tag, use fb:user-item tags to specify the set of users. This tag only works on profile pages. Applications cannot use this on their canvas pages. Attributes Required Name Type Description optional cols int The number of columns in the table.
facebook FBML Reference Guide Page 29 of 159 Fb:user-item Description Renders a single cell of a table, which contains a thumbnail and name for a particular user, similar to the Mutual Friends table on profile pages. Must be used inside a fb:user-table tag. This tag only works on profile pages. Applications cannot use this on their canvas pages. Attributes Required Name Type Description required uid uid The ID of the user whose name and photo you want to show.
facebook FBML Reference Guide Page 30 of 159 Fb:subtitle Description Defines the subtitle for the profile box. The enclosed content is interpreted purely as plain text. This tag may contain fb:action, an optional tag that renders an action link on the right-hand side of the subtitle. Attributes Required Name Type Description optional seeallurl string The URL for a "See all" link. This URL must be a canvas page. Examples PAGE 31facebook FBML Reference Guide Page 31 of 159 Fb:action Description Renders a link, usually for navigational purposes. Its appearance depends on its container. The tag must be a child of either fb:dashboard or fb:subtitle. Attributes Required Name Type Description required href string The URL for the link. The URL must be a canvas page. For example, href="http://apps.facebook.com//.php". optional title string Specifies the text to display as a tool tip for this link.
facebook FBML Reference Guide Page 32 of 159 See Also You can see a real world example of this tag in the Who's Showing Up demo application. Go to Demos for more details and to download and install the demo apps. www.yapish.
facebook FBML Reference Guide Page 33 of 159 Visibility on Profile Fb:visible-to-owner Description Displays content inside only if the viewer of the profile matches the profile owner. This also works for Facebook Pages with the content only displayed to an admin of the Page. Attributes Required Name Type Description bgcolor color The color of the blank box shown to users who are not the owner.
facebook FBML Reference Guide Page 34 of 159 Fb:visible-to-user Description Only displays the content inside the tag if the viewer is the specified user.[verify] This also works for Facebook Pages with the content only displayed to an admin of the Page and the viewer is not on a Page profile. Attributes Required Name Type Description required int uid The uid of the user that is allowed to see the content.
facebook FBML Reference Guide Page 35 of 159 Fb:visible-to-friends Description Use this tag to display the content inside the tag on a user's profile only if the viewer is a friend of that user. While this tag is still valid, you may find it more versatile to use fb:visible-to-connection, since it applies equally to user profiles and Facebook Pages. Attributes Required Name optional Type Description bgcolor color The color of the blank box shown to viewers who are not friends of the user.
facebook FBML Reference Guide Page 36 of 159 Fb:visible-to-app-users Description Displays the enclosed content only if the viewer has granted full permissions to the application.[verify] Attributes Required Name Type Description bgcolor color The color of the blank box shown to users who do not own the app. Examples Welcome users! Notes This is new to FBML v1.1. Do not use this tag to display private or sensitive information.
facebook FBML Reference Guide Page 37 of 159 Fb:visible-to-added-app-users Description Displays the enclosed content only if the viewer has added the application to their account.[verify] Attributes Required Name Type Description bgcolor color The color of the blank box shown to users who are not the owner or have added the app. Examples Hey, welcome! Thanks for adding my app! Notes This is new to FBML v1.1.
facebook FBML Reference Guide Page 38 of 159 Fb:visible-to-connection Description Use this tag to display the content inside the tag on a user's or a Facebook Page's profile only if the viewer is a friend of that user or is a fan of that Facebook Page. Attributes Required Name optional Type Description bgcolor color The color of the blank box shown to viewers who are not friends of the user or fans of the Page.
facebook FBML Reference Guide Page 39 of 159 Fb:18-plus Description Restricts content to users who are age 18 or older. Examples Oooh la laBarney? www.yapish.
facebook FBML Reference Guide Page 40 of 159 Fb:21-plus Description Restricts content to users who are age 21 or older. Examples Oooh la laBarney? www.yapish.
facebook FBML Reference Guide Page 41 of 159 Embedded media Fb:iframe Description Inserts an
facebook FBML Reference Guide Page 42 of 159 Fb:photo Description Renders a Facebook photo. Attributes Required Name Type Description required pid int An API-supplied pid of the photo, or any pid found in the query string of a photo URL on Facebook. optional uid int If the pid is not an API-supplied pid, this should be the ID parameter in the query string used to find the pid. size string The size of the photo to display. (default value is normal).
facebook FBML Reference Guide Page 43 of 159 Fb:mp3 Description Renders a flash-based audio player. Attributes Required Name Type Description required src string The URL of the audio file. The URL must be absolute. optional title string The name of the song. artist string The name of the artist performing the song. album string The title of the album. width int The width of the player in pixels. (default value is 300) height int The height of the player in pixels.
facebook FBML Reference Guide Page 44 of 159 Fb:swf Description Renders a Shockwave Flash (SWF) object. On profile pages, an image appears first. When the user clicks the image, it turns into the Flash object. On canvas pages, the image is ignored, and the Flash object is directly included. Attributes Required Name Type Description required swfsrc string The URL of the Flash object. The URL must be absolute. optional imgsrc string The URL of the image (.gif and .jpg formats only).
facebook FBML Reference Guide Page 45 of 159 fb_sig_profile int The uid of the user into whose profile the Flash object is being loaded; this is blank when loaded in the canvas. fb_sig_time int The time when the signature was generated. fb_sig_user int The uid of the currently logged in user. fb_sig_session_key string The Facebook session key. fb_sig_expires int The session expiration time. fb_sig_api_key string Your application's API key.
facebook FBML Reference Guide Page 46 of 159 Notes Currently, Facebook requires Flash version 9.0.0 for all tags. Make sure that the flashvars parameter is all lowercase. Some sources of embedded links capitalize the V, which does not work on Facebook. Currently, Facebook wraps the resultant Flash object in a tag, so despite the fact that the embed/object tag is not block-level, consecutive
tags will appear one above the other instead of side-by-side.facebook FBML Reference Guide Page 47 of 159 Fb:flv Description Renders a Flash-based FLV player that can stream arbitrary FLV (video/audio) files on the page. Attributes Required Name Type Description required src string The URL of the FLV file. The URL must be absolute. optional height int The height of the video container in pixels. width int The width of the video container in pixels. title string The name of the video.
facebook FBML Reference Guide Page 48 of 159 Fb:silverlight Description Renders a Microsoft Silverlight control. On profile pages, an image appears first. When the user clicks the image, it turns into the control. On canvas pages, the image does not appear, and the Silverlight control is directly included. Attributes Required Name Type Description required silverlightsrc string The URL of the Silverlight control. optional imgsrc string The URL of the image (.gif and .jpg formats only).
facebook FBML Reference Guide Page 49 of 159 Tools Fb:board Description This tag is currently in beta. It is available for all applications. Please post any bugs in bugzilla. Displays a discussion board for a unique identifier. Facebook handles see all page, topic display, posting and storage. Fb:board is Facebook discussion board for developers to drop on canvas pages easily. It is not designed to be fully extensible or for the developer to get the data in the posts.
facebook FBML Reference Guide returnurl string Page 50 of 159 The URL where the user is returned after selecting a "back" link. (default value is the current page) Examples Discuss the Titans Notes This tag may contain fb:title History [Nov 7 2007] fb:board went into production as a semi-public beta.
facebook FBML Reference Guide Page 51 of 159 Fb:comments Description Displays a set of comments for a unique identifier. Facebook handles posting, drawing, and see all page. Fb:comments is essentially a wall for developers to drop on canvas pages easily. Using the tag implies a walllike comments set exists that can be posted or identified by the passed xid. Please note the following: Every pageload for posting, see all page, and so forth refetches the configuration from the callbackurl supplied.
facebook FBML Reference Guide Page 52 of 159 Examples Talk about the Titans Code Snippet - Tracking the Comment Count Notes This tag may contain fb:title. www.yapish.
facebook FBML Reference Guide Page 53 of 159 Fb:friend-selector Description Renders a predictive friend selector input for a given person. You can use this tag inside an fb:request-form to select users for whom a request can be sent. Attributes Required Name Type Description optional uid int The user whose friends you can select. (default value is the uid of the currently logged-in user) name string The name of the form element.
facebook FBML Reference Guide Page 54 of 159 See Also You can see a real world example of this tag in the Footprints demo application. Go to Demos for more details and to download and install the demo apps. www.yapish.
facebook FBML Reference Guide Page 55 of 159 Fb:google-analytics Description Inserts appropriate Google Analytics code into a canvas page. Attributes Required Name Type Description required uacct string Your Urchin/Google Analytics account ID. optional page string The argument given to the urchinTracker() function, either a page or a virtual page. ufsc bool Sets client info flag, where 1=on and 0=off. This is a UTM user setting.
facebook FBML Reference Guide Page 56 of 159 uccn string The name of the campaign. This is a UTM campaign tracking setting. (default value is utm_campaign) ucmd string Represents the campaign medium. Specify cpc, cpm, link, email or organic. This is a UTM campaign tracking setting. (default value is utm_medium) ucsr string Represents the campaign source. This is a UTM campaign tracking setting. (default value is utm_source) uctr string The campaign term or keyword.
facebook FBML Reference Guide Page 57 of 159 Fb:if Description Only renders the content inside the tag if value tag is set to true. Attributes Required Name Type Description optional value bool Displays content if true. (default value is false) Examples Show this content. www.yapish.
facebook FBML Reference Guide Page 58 of 159 Fb:else Description Handles the else case inside any fb:if, fb:if-* or fb:is-in-network tag. Applicable tags include: 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 fb:is-in-network Examples Welcome back to your profile! This is not your profile.
facebook FBML Reference Guide Page 59 of 159 Fb:mobile Description Renders the contained content only when viewed on the mobile website (http://m.facebook.com). Any content outside these tags does not get rendered on the mobile website. Examples This text appears on the regular site, but not on m.facebook.com. This text appears only on m.facebook.com. www.yapish.
facebook FBML Reference Guide Page 60 of 159 Fb:multi-friend-input Description Renders a multi-friend form entry field like the one used in the message composer. You can use the field inside an fb:request-form to select users for whom a request can be sent. Output Adds the following hidden tag inside the form for each user with their user ID for the value. Here is an example, in PHP, of how to access these IDs.
facebook FBML Reference Guide Page 61 of 159 When used, it appears to disable the recipient input box on the popup for fb:share-button. [possible bug?] When more than one instance of this tag appears on a page, only the first instance works. [possible bug?] www.yapish.
facebook FBML Reference Guide Page 62 of 159 Fb:random Description Randomly chooses an item inside the tags based on the weights provided. fb:random allows the developer to input a series of tags, of which one or more are shown randomly. Each item can have a weight and the tag can be specified to show more than one choice. Each option should be wrapped in an fb:random-option tag. Attributes Required Name Type Description optional int pick The number of items to choose from the random subset.
facebook FBML Reference Guide Page 63 of 159 Fb:random-option Description Contains code to be output when selected by the fb:random tag. You can control the frequency of this pick with the weight attribute. The fb:random-option tag must be inside an fb:random tag. Attributes Required Name Type Description optional weight float Allows for controlling the frequency of a choice. (default value is 1.0) Examples A: This text appears twice as often as B.
facebook FBML Reference Guide Page 64 of 159 Fb:switch Description Evaluates every fb: tag inside and returns the first one that evaluates to anything other than an empty string. You can use fb:default to specify a default that gets rendered if nothing else does before it was executed. Examples You can't see either the photo or the profile pic Note: fb:default always returns its content.
facebook FBML Reference Guide Page 65 of 159 Fb:default Description This article or section needs expansion For a group of fb: tags contained within an fb:switch tag, the fb:default tag renders any content inside itself if no other fb: tag inside the fb:switch tag renders code before it. Examples You can't see either the photo or the profile pic a screenshot is not applicable for this tag www.
facebook FBML Reference Guide Page 66 of 159 Fb:user-agent Description Displays the contents wrapped inside the tag to the specified user-agents. You can use fb:user-agent on the canvas page and the profile box. It serves as a tool to deal with browser idiosyncrasies. User-Agent Resources http://www.user-agents.org/index.shtml - a list of common user agent strings http://whatsmyuseragent.
facebook FBML Reference Guide Page 67 of 159 Notes If both the includes and excludes attributes exist, the order of operation is to evaluate the includes then the excludes. For example, you can state includes="MSIE" excludes "MSIE 6.0". The matching is case-insensitive. www.yapish.
facebook FBML Reference Guide Page 68 of 159 Fb:typeahead-input Description This tag is currently in beta. Please post bugs in the Bug Tracker. Creates a type-ahead tool (as suggested) that will give you the results that you specify. To add options in the input box, use fb:typeahead-option. Attributes Required Name Type optional Description name string The variable name that is sent in the POST request when the form is submitted. Examples fb:fbml version="1.
facebook FBML Reference Guide Page 69 of 159 http://bugs.developers.facebook.com/show_bug.cgi?id=1372 www.yapish.
facebook FBML Reference Guide Page 70 of 159 Fb:typeahead-option Description This tag is currently in beta. Please post bugs in the Bug Tracker. This tag specifies the values for a typeahead form input. You must use it in conjunction with Fb:typeaheadinput. Attributes Required Name Type optional Description value string The value assigned to the fb:typeahead-input element, used in the POST request when the form is submitted. Examples PAGE 71facebook FBML Reference Guide Page 71 of 159 Misc Fb:js-string Description This tag renders a block of FBML into an FBML block variable instead of rendering it on the page. You can use this variable in your JavaScript with setInnerFBML. See FBJS for more information. Attributes Required Name Type Description required var string A valid JavaScript identifier. Examples Pre-rendered FBML content.
facebook FBML Reference Guide Page 72 of 159 www.yapish.
facebook FBML Reference Guide Page 73 of 159 Fb:fbml Description Defines a block of FBML to be rendered in a specific version of FBML. Attributes Required Name Type Description optional version float The version of FBML with which to render the content. (default value is [the current version]) Examples The tags that follow rely completely on FBML in version 1.0. This is being rendered in version: The tags here rely on FBML 1.
facebook FBML Reference Guide Page 74 of 159 Fb:fbmlversion Description Prints the version of FBML currently in scope. You should use this tag only for debugging purposes. Attributes Required Name Type Description optional version float The version of FBML with which to render the content. (default value is [the current version]) Examples The tags that follow rely completely on FBML in version 1.0.
facebook FBML Reference Guide Page 75 of 159 Fb:redirect Description Redirects a user's browser to a new URL within the Facebook canvas. Attributes Required Name Type required url string Description The URL where you are redirecting the browser. Note this does not work within a profile box. Examples a screenshot is not applicable for this tag www.yapish.
facebook FBML Reference Guide Page 76 of 159 Fb:ref Description Fetches and renders FBML from a given ref source – either a ref string "handle" you've created using fbml.setRefHandle or a URL that serves FBML. You can use this ref to publish identical FBML to a large number of user profiles and subsequently update those profiles, without having to republish FBML on behalf of each user (that is, using profile.setFBML for each user).
facebook FBML Reference Guide Page 77 of 159 Cache Expiration As mentioned within a forum thread by a member of the Facebook team: "You only need to publish on update. We'll keep it otherwise." So the cache never expires and you will not need to periodically update your application cache. Facebook will keep the cache indefinitely. However, developers should not rely on the cache always keeping their data – i.e.
facebook FBML Reference Guide Page 78 of 159 Fb:share-button Description Renders a standard Share button in a profile for the specified URL or content. Attributes Required Name Type Description class string The type of share. Valid values are url, to render a share of the URL specified with the href attribute, and meta, to render a share with the given data. required href string The reference URL to share. This attribute is required for the url class only.
facebook FBML Reference Guide Page 79 of 159 Fb:time Description Renders the date and time in the user's time zone. Attributes Required Name Type Description required t int The time to display in epoch seconds. optional tz string The time zone in which to display t. Acceptable formats include PHP's List of Supported Timezones and +/- formats such as Etc/GMT-7. Note: Due to a bug (see below) when using a timezone in the Etc/GMT format the time is relative to the timezone.
facebook FBML Reference Guide Page 80 of 159 Fb:title Description Sets the page's
tag to its contents. Alternatively, when used inside fb:comments, sets the title for the Wall. Examples This is the canvas page window title Facebook | App Name | This is the canvas page window title www.yapish.facebook FBML Reference Guide Page 81 of 159 Fb:page-admin-edit-header Description For apps that can be added to Facebook Pages, this adds a standardized edit header for canvas pages so that the Page owner can easily jump to their Page's app configuration. Notes This tag should be placed at the top of all pages that the Page admin can use to edit their application on their page. This tag only works on a canvas page.
facebook FBML Reference Guide Page 82 of 159 Forms Fb:submit Description Creates a JavaScript submission mechanism for a form, which makes image or text links act as Submit buttons. Markup contained by this tag is surrounded with an tag that includes a submit onclick action. This article or section needs expansion Attributes Required Name Type Description optional form_id string The ID of the form to be submitted. Examples PAGE 83
facebook FBML Reference Guide Page 83 of 159 Message/Wall attachments Fb:attachment-preview Description Renders a link in a wall or message attachment that, when clicked, replaces that attachment with newly fetched content. The URL from which the content is fetched is a hidden input in the current content, and all other inputs in the content are posted. This article or section needs expansion Attributes Examples This is a basic outline of how to setup attachments.
facebook FBML Reference Guide Page 84 of 159 When the user clicks your "attach" link, Facebook calls your script and displays it in a pop-up dialog like the one below. Each time the user clicks the "Preview" link, Facebook calls your attach script again with the values of the form inputs as POST variables, and updates the dialog with whatever your script returns.
facebook FBML Reference Guide Page 85 of 159
Choice One |
Choice Two |
PAGE 86 facebook FBML Reference Guide Page 86 of 159 Notifications and requests Fb:notif-subject Description Specifies the content of the email subject line for a notification sent with the notifications.send call. Examples You have a new message! See Also You can see a real world example of this tag in the Footprints demo application. Go to Demos for more details and to download and install the demo apps. www.yapish. facebook FBML Reference Guide Page 87 of 159 Fb:notif-page Description Specifies content of a notification that appears on a user's Notifications page. This tag is used with the notifications.send call. Examples Please check out this awesome app! See Also fb:notif-email fb:notif-subject www.yapish. facebook FBML Reference Guide Page 88 of 159 Fb:notif-email Description Specifies content of the email body for a notification sent with the notifications.send call. Examples You have a new message! See Also fb:notif-page fb:notif-subject www.yapish. facebook FBML Reference Guide Page 89 of 159 Fb:req-choice Description Specifies a button to be shown at the bottom of a request on the user's requests page. Attributes Required Name Type required Description url string The URL to which the button should take the user upon click. must be an absolute label string Specifies the text to display on this button. Examples PAGE 90facebook FBML Reference Guide Page 90 of 159 Fb:request-form Description Creates a form that sends requests to the selected users. To send requests/invitations to users, create one of these forms and include either an fb:multi-friend-selector or any combination of fb:multi-friend-input, fb:friendselector and fb:request-form-submit. The form is submitted after the user confirms the sending of the request. facebook FBML Reference Guide ids array Page 91 of 159 A zero-based array containing all of the user IDs of the people the user invited. Examples Example FBML Invite Page "); ?>"> PAGE 92facebook FBML Reference Guide Page 92 of 159 protected Map referenceData(HttpServletRequest request) throws Exception { logger.info("InviteFriendsFormController.referenceData ..."); FacebookRestClient facebookRestClient = getFacebookUtils().getFacebookRestClient(request); //get the list of friends who are app users so they can be excluded from the invite page String appUserFriends = getFacebookUtils().getAppUsersFriendsString(facebookRestClient); HashMap referenceData = new HashMap(); referenceData. facebook FBML Reference Guide Page 93 of 159 Example PHP Invite Page require_login(); // Get list of friends who have this app installed... $rs = $facebook->api_client->fql_query("SELECT uid FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1 = $user)"); $arFriends = ""; www.yapish. facebook FBML Reference Guide Page 94 of 159 // Build an delimited list of users... if ($rs) { for ( $i = 0; $i < count($rs); $i++ ) { if ( $arFriends != "" ) $arFriends .= ","; $arFriends .= $rs[$i]["uid"]; } } // Construct a next url for referrals $sNextUrl = urlencode("&refuid=". facebook FBML Reference Guide Page 95 of 159 Example Overloaded Form www.yapish. facebook FBML Reference Guide Page 96 of 159 Notes Make sure to include whatever attributes you would normally include if you were creating a facebook FBML Reference Guide Page 97 of 159 Fb:multi-friend-selector Description There are actually two versions of this button - the full version and the condensed version. This page describes the full version. For information about the condensed version, see fb:multi-friend-selector (condensed). This is a nearly full-page interface intended to be used on canvas pages to allow the user to send a "large" number of requests or invitations (where "large" is generally some number more than 4). facebook FBML Reference Guide Page 98 of 159 Post Variables Required Name Type Description ids array An array of the user IDs chosen by the user. Examples www.yapish. facebook FBML Reference Guide Page 99 of 159 Fb:multi-friend-selector (condensed) Description There are actually two versions of this button - the full version and the condensed version. This page describes the condensed version. For information about the full version, see fb:multi-friend-selector. This is a more condensed version of an interface which must be used inside an fb:request-form to select some number of friends to send an invitation or request. facebook FBML Reference Guide Page 100 of 159 Examples PAGE 101facebook FBML Reference Guide Page 101 of 159 www.yapish. facebook FBML Reference Guide Page 102 of 159 Fb:request-form-submit Description Creates a button that submits an fb:request-form. Use this along with any combination of fb:multi-friend-input or fb:friend-selector tags inside an fb:request-form if you would like to have the user send a request or invitation. When this button is clicked, a confirmation dialog appears that allows the user to confirm the sending of the request or invitations. You can also use a single user ID as the label for the button. facebook FBML Reference Guide Page 103 of 159 Fb:application-name Description Renders the application name. Use this tag to render the name of an application. This can also be used when you cannot use the application name directly, e.g. to include the application name in a Mini-Feed or News Feed story when that application contains the word "message". Examples MessageMe! www.yapish. facebook FBML Reference Guide Page 104 of 159 Status messages Fb:error Description Renders a standard Facebook error message. The content within the tags is used as the error message text. Attributes Required Name Type Description required message string The heading text to display in the error box. Alternately, you can specify the heading text using an fb:message child. facebook FBML Reference Guide Page 105 of 159 Fb:explanation Description Renders a standard Facebook explanation message. The content contained within the tags is used as the explanation text. Attributes Required Name Type Description required message string The heading text to display in the explanation box. Alternately, you can specify the heading text using an fb:message child. facebook FBML Reference Guide Page 106 of 159 Fb:success Description Renders a standard Facebook success message. The content within the tags is used as the success explanation. Attributes Required Name Type Description required message string The heading text to display in the success box. Alternately, you can specify the heading text using an fb:message child. facebook FBML Reference Guide Page 107 of 159 Fb:message Description Renders the heading text for an error, explanation or success message. Examples fb:message> This is the heading text for the message. Notes You must use this tag inside fb:error, fb:explanation, or fb:success. www.yapish. facebook FBML Reference Guide Page 108 of 159 Fb:editor Description Creates a form with two columns, just like the form on the edit-profile page. The children of fb:editor specify the rows of the form. For example, an fb:editor-text child adds a row with a text field in the right column. The label attribute of the fb:editor-* child specifies what text appears in the left column of that row. Warning: This form is submitted via POST method. facebook FBML Reference Guide Page 109 of 159 Notes Mock AJAX There is currently no way to implement Mock AJAX using fb:editor. In order to use Mock AJAX, you must mimic the HTML equivalent of fb:editor and combine it with Mock AJAX as described at [1]. This tag may contain any of the following tags: fb:editor-text fb:editor-textarea fb:editor-time fb:editor-month fb:editor-date fb:editor-divider fb:editor-buttonset fb:editor-button fb:editor-cancel fb:editor-custom www.yapish. facebook FBML Reference Guide Page 110 of 159 Fb:editor-button Description Renders a button of type submit inside an fb:editor tag. This tag can be a child of an fb:editor-buttonset container to render multiple buttons next to each other. If the button is not in a fb:editor-buttonset, the button still renders, but is not styled as an editor-button.[possible bug?] Attributes Required Name Type Description required value string The text label for the button. facebook FBML Reference Guide Page 111 of 159 Fb:editor-buttonset Description A container for one or more fb:editor-button tags, which are rendered next to each other with some space between each button. Examples Notes This tag must contain at least one fb:editor-button as a child. www.yapish. facebook FBML Reference Guide Page 112 of 159 Fb:editor-cancel Description Renders a Cancel button inside an fb:editor tag. Attributes Required Name Type optional Description value string The caption for the button. (default value is "Cancel") href string The URL to redirect to upon clicking. (default value is "#") This doesn't actually cancel anything, so you should set the href to at least reload the page. Examples PAGE 113facebook FBML Reference Guide Page 113 of 159 Fb:editor-custom Description Allows you to put any content into an fb:editor block, as long as it is valid FBML. Attributes Required Name Type Description optional label string The label text for left hand side. id string The identifier tag for fb:editor. Examples This creates a drop down selector. facebook FBML Reference Guide Page 114 of 159 Fb:editor-date Description Creates two drop down list boxes that let a user select a date. The month is listed using a three-letter abbreviation, and the day is listed as a numerical digit from 1 to 31 (with no leading zeroes). You can only use one date selector per page. Attributes Required Name Type string required label optional value int Description The label to display to the left of both selectors. facebook FBML Reference Guide Page 115 of 159 Fb:editor-divider Description Renders a horizontal line separator in the column containing the form elements. Despite appearing like an element, it is actually a with a class of divider. Examples www.yapish. facebook FBML Reference Guide Page 116 of 159 Fb:editor-month Description Creates a form selector element displaying the month. This article or section needs expansion Attributes Required Name Type optional Description name string The name for the control. (default value is month) value int The value to pre-fill (the number of the month, 1 for Jan, 2 for Feb, etc). facebook FBML Reference Guide Page 117 of 159 Fb:editor-text Description Creates an of type text. Attributes Required Name Type Description optional label string The label to display on the left side of the text box. name string The name for the control. value string The default text that populates the text box. maxlength int The maximum length of the input allowed in the text box. facebook FBML Reference Guide Page 118 of 159 Fb:editor-textarea Description Creates a facebook FBML Reference Guide Page 119 of 159 Fb:editor-time Description Creates a series of form selector elements showing the time in hours and minutes, and an AM/PM indicator. Attributes Required Name Type optional label string Description The label to display on the left side of the selector. (default value is blank) name string The name of the field that is passed when the form is submitted. facebook FBML Reference Guide Page 120 of 159 Page navigation Fb:dashboard Description Renders a standard Facebook dashboard header. Dashboards can contain the following elements: fb:action fb:create-button fb:help Attributes Examples Notes For an application with an icon, the icon appears next to the application title. You cannot include tags like fb:if-user-has-added-app inside a dashboard. facebook FBML Reference Guide Page 121 of 159 {include file='header-actions-external.tpl'} Add this app {/if} See Also You can see a real world example of this tag in the Restaurants demo application. Go to Demos for more details and to download and install the demo apps. www.yapish. facebook FBML Reference Guide Page 122 of 159 Fb:action Description Renders a link, usually for navigational purposes. Its appearance depends on its container. The tag must be a child of either fb:dashboard or fb:subtitle. Attributes Required Name Type Description required href string The URL for the link. The URL must be a canvas page. For example, href="http://apps.facebook.com//.php". optional title string Specifies the text to display as a tool tip for this link. facebook FBML Reference Guide Page 123 of 159 See Also You can see a real world example of this tag in the Who's Showing Up demo application. Go to Demos for more details and to download and install the demo apps. www.yapish. facebook FBML Reference Guide Page 124 of 159 Fb:create-button Description Renders a Create button for adding user-generated content. This tag must be a child of fb:dashboard. Attributes Required Name Type Description required href string The URL where the link for the button takes the user. The URL must be a canvas page. optional title string Specifies the text to display as a tool tip for this link. onclick string Call a FBJS function Examples PAGE 125facebook FBML Reference Guide Page 125 of 159 Fb:help Description Renders a help link. This tag must be a child of fb:dashboard. Attributes Required Name Type Description required href string The URL for the help page. optional title string Specifies the text to display as a tool tip for this link. Examples Help Me! Notes This button appears in the top right of the fb:dashboard element. www.yapish. facebook FBML Reference Guide Page 126 of 159 Fb:header Description Renders a standard Facebook title header. Attributes Required Name Type Description optional bool Toggles whether the application icon is displayed. No other icon can be displayed. (default value is true) icon decoration string Customize the appearance of the title by choosing among three styles: add_border - Adds a 1px solid #ccc border to the bottom of the header. Useful for pages with gray backgrounds below the header. facebook FBML Reference Guide Page 127 of 159 See Also You can see a real world example of this tag in the Restaurants demo application. Go to Demos for more details and to download and install the demo apps. www.yapish. facebook FBML Reference Guide Page 128 of 159 Fb:mediaheader Description Renders a standard media header, intended mainly for displaying content contributed by a particular user. The media header is shown at the top of See All pages throughout Facebook. It contains a photo of the media owner and links to actions on that user. The links shown to the content owners must be specified using fb:owner-action tags. facebook FBML Reference Guide Page 129 of 159 Fb:header-title Description Specifies the header title for a fb:mediaheader. Examples Header title www.yapish.facebook FBML Reference Guide Page 130 of 159 Fb:owner-action Description Specifies an action link to be displayed inside a fb:mediaheader when the viewer is the owner of the content Attributes Required Name Type Description required href string the URL corresponding to the action. Examples Content header PAGE 131facebook FBML Reference Guide Page 131 of 159 Fb:tabs Description Renders a group of standard Facebook navigation tabs. Must contain at least one fb:tab-item. Examples www.yapish. facebook FBML Reference Guide Page 132 of 159 Fb:tab-item Description Renders a standard Facebook tab. Must always be a child of fb:tabs. Attributes Required Name Type Description required href string The URL to which the link should take the user upon click. must be absolute title string Specifies the text to display on the tab. align string Specify alignment for this tab item. (default value is left). facebook FBML Reference Guide Page 133 of 159 Notes fb:tabs and fb:tab-item do not render correctly within the FBML Test Console Dynamic FBML, clicktohide, clicktoshow, etc., does not work with this FBML tag. www.yapish. facebook FBML Reference Guide Page 134 of 159 Dialog Fb:dialog Description Important: The fb:dialog tag is in beta mode right now, which means there is a possibility it can change. When it is fully stable, Facebook will update the announcements page and remove this note. In the meantime, we would appreciate any feedback/issues you have about fb:dialog. Bug Reports and Feature Requests: Talk:fb:dialog The fb:dialog tag displays a standard popup dialog box when a user clicks on some element. facebook FBML Reference Guide Page 135 of 159 My Little Dialog Part II I'm glad you like my dialog Sample Code with Form Submission To have a fb:dialog-button submit a form upon click, you must specify a form_id attribute on the fb:dialog-button. facebook FBML Reference Guide Page 136 of 159 Fb:dialog-title Description fb:dialog-title is a child of fb:dialog and renders a title for what is displayed inside the popup dialog. Requirements: must be inside a fb:dialog tag. Examples My Little Dialog PAGE 137facebook FBML Reference Guide Page 137 of 159 Fb:dialog-content Description The fb:dialog-content tag is a child of fb:dialog and represents the content that gets displayed inside the popup dialog when it appears. This section can be styled like any other part of your app. facebook FBML Reference Guide Page 138 of 159 Fb:dialog-button Description Renders a button for the fb:dialog popup. The fb:dialog-button tag is a child of fb:dialog and must be contained within it. Attributes Required Name Type Description required type string The type of button. Specify button for a general button or submit for a Submit button to submit the form. value string The label text for the button. facebook FBML Reference Guide Page 139 of 159 Wall Fb:wall Description Emulates a wall environment. Examples This is a wall post from uid 12345 See Also fb:wallpost www.yapish. facebook FBML Reference Guide Page 140 of 159 Fb:wallpost Description Renders a wall-style post. You should use it inside fb:wall tags, but it renders fine without them. It can also contain an fb:wallpost-action tag, which places a link at the bottom of the post. Attributes Required Name Type Description required uid int The user ID of the author of the post. FBML cannot parse without it, resulting in a runtime error. facebook FBML Reference Guide Page 141 of 159 Fb:wallpost-action Description Displays a link at the bottom of a wallpost (even if it appears before other text within the fb:wallpost tag). Attributes Required Name required href Type Description the URL of the link. must be absolute Examples This is a wall post from uid 12345. This is a small blue link in the post www. facebook FBML Reference Guide Page 142 of 159 Dynamic FBML attributes Summary Visibility (clicktoshow, clicktohide,clicktotoggle) Mock AJAX (clickrewriteid, clickrewriteurl,clickrewriteform) Forms (clicktoenable, clicktodisable,clickthrough) Requirelogin FBJS Details DynamicFBML/Visibility Description These elements all control the visibility of an element or a set of elements. Format is clickto*="id1,id2,id3". clicktoshow - Sets the specified IDs to visible. facebook FBML Reference Guide Page 143 of 159 to be.) To prevent this from happening, use a bookmark name that does not exist, such as href="#nonexistantbookmark". www.yapish. facebook FBML Reference Guide Page 144 of 159 DynamicFBML/MockAJAX Attributes clickrewriteid - This is the id of the div that will be replaced by the returned data. clickrewriteurl - This is the (non-canvas) url from which it will grab the data. clickrewriteform - This is the form to use when submitting. Usage examples Sample code, with more details, is available at Mock Ajax page. Examples A live demonstration can be found here. facebook FBML Reference Guide Page 145 of 159 DynamicFBML/Forms Attributes clicktoenable - Will enable the form elements specified by id. clicktodisable - Will disable the form elements specified by id. clickthrough - Will allow clicks on elements using Dynamic FBML to go through to the element. facebook FBML Reference Guide Page 146 of 159 Requirelogin Description You can add the attribute requirelogin to anchor tags to ensure that the user will be logged in before accessing the anchor link. A user who is not logged in to your application and clicks on a link with requirelogin=1 will see a popup dialog prompting them to log into your application. A user who is already logged in to your application (has a valid session) will be able to follow through to the link as they normally would. facebook FBML Reference Guide Page 147 of 159 FBJS Description FBJS is Facebook's solution for developers who want to use JavaScript in their Facebook applications. We built FBJS to empower developers with all the functionality they need, and to protect our users' privacy at the same time. How It Works Most providers who allow developers to embed JavaScript within their domain force developers to use iframes to sandbox their code. Facebook has taken a different approach to this problem. facebook FBML Reference Guide Page 148 of 159 //--> As you can see, creating FBJS is very similar to JavaScript. Note, however, that this example may not work as expected: Hello World! |