Here are some miscellaneous tags:

  • <fb:js-string> allows you to define a string to reference in FBJS. You can set this anywhere in your code, and it is not displayed to the user. For example: <fb:js-string var="foo">This is the rendered text</fb:js-string>.
  • <fb:fbml> allows you to define the specific version of FBML. Currently, the valid versions include 1.0 and 1.1.
  • <fb:fbmlversion> displays the version of FBML that is currently being used.
  • <fb:redirect> redirects the browser to another URL in your application.
  • <fb:ref> allows you to define FBML that resides at a specific URL that you then call through the tag. This is generally used when you want to update a lot of profiles without publishing the data on a per-user basis.
  • <fb:share-button> creates a share button with either URL information or specific metadata.
  • <fb:time> renders a time in the user’s time zone.
  • <fb:title> sets the page’s title tag.

Working with form information is important in developing any online application. FBML has some constructs to help with these common tasks.

  • <fb:request-form> creates a form for sending requests. This is a great way to let your users send requests to add the application (when used with the <fb:multi-friend- seletor> tag). You cannot use this tag if you are using iframes.
  • <fb:request-form-submit> creates a submit button for use with the <fb:request-form> tag.
  • <fb:multi-friend-input> renders a multifriend input field like the one used in the message composer.
  • <fb:friend-selector> renders an autocomplete input box of the user’s friends.
  • <fb:submit> creates a JavaScript submit button for your forms. This is generally used when you want to use an image instead of a submit button, such as <fb:submit><img src="path/to/image" /></fb:submit>.

Tag-based languages such as ColdFusion and JSTL have many tags that build portions of your application for you। Similarly, FBML has a set of tags to help you build some very useful portions of your application:

  • <fb:comments> generates code to add comments to an application। It takes care of posting and redrawing pages that are posted to for a given UID.
  • <fb:google-analytics> adds the JavaScript to your application so you can use Google Analytics to track your application usage.
  • <fb:mobile> displays content for mobile users (http://m.facebook.com/)। Content outside of these tags will be ignored for mobile users.
  • <fb:random> randomly rotates certain parts of your application content (for quotes, pictures, or even advertising). This tag not only can randomly choose an element from within the tag (defined by the <fb:random-option> tag) but also can weight these options to appear more often (or less often) than other options.

You might encounter instances in which you want to display specific content to your users depending on their profile status with your application। FBML allows you to distinguish between the application owner, users, application users (those who have granted full access to your application), and those who have added the application to their accounts।

  • <fb:visible-to-owner> displays content if the user is the owner। As a side note, if the user isn’t the owner, this displays whitespace।
  • <b:visible-to-user> displays content to the specified user।
  • <fb:visible-to-app-users> displays content if the user has granted full permissions to the application।
  • <fb:visible-to-added-app-users> displays content if the user has added the application to their account.