Facebook Developers
DocumentationSupportBlogAppsLog In
  • Getting Started
  • Core Concepts
  • Advanced Topics
    • Dialogs
    • FQL
    • Internationalization
    • Ads API
    • Credits
    • Chat API
    • Legacy REST API
    • Legacy FBML
    • Legacy FBJS
    • Legacy Javascript SDK
  • SDK Reference
  • Tools
  • Tools
    • fb:board
    • fb:bookmark
    • fb:chat-invite
    • fb:comments
    • fb:default
    • fb:else
    • fb:feed
    • fb:friend-selector
    • fb:google-analytics
    • fb:if
    • fb:if-multiple-actors
    • fb:multi-friend-input
    • fb:quantcast
    • fb:random
    • fb:random-option
    • fb:switch
    • fb:typeahead-input
    • fb:typeahead-option
    • fb:user-agent
  • User/Groups
    • fb:eventlink
    • fb:grouplink
    • 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-user
    • fb:if-is-verified
    • fb:name
    • fb:profile-pic
    • fb:pronoun
    • fb:user
    • fb:user-status
  • Notifications and Requests
    • fb:application-name
    • fb:multi-friend-selector
    • fb:multi-friend-selector_(condensed)
    • fb:req-choice
    • fb:request-form
    • fb:request-form-submit
  • Platform Internationalization
    • fb:date
    • fb:fbml-attribute
    • fb:intl
    • fb:intl-token
    • fb:tag
    • fb:tag-attribute
    • fb:tag-body
    • fb:window-title
  • Deprecated
    • fb:if-is-own-profile
    • fb:if-user-has-added-app
    • fb:networklink
    • fb:notif-email
    • fb:notif-page
    • fb:notif-subject
    • fb:profile-action
    • fb:rock-the-vote
    • fb:userlink
    • fb:visible-to-added-app-users
    • fb:visible-to-user
  • Status Messages
    • fb:error
    • fb:explanation
    • fb:message
    • fb:success
  • Page Navigation
    • fb:create-button
    • fb:dashboard
    • fb:header
    • fb:header-title
    • fb:help
    • fb:mediaheader
    • fb:owner-action
    • fb:tab-item
    • fb:tabs
  • Wall
    • fb:wall
    • fb:wallpost
    • fb:wallpost-action
  • Visibility on Profile
    • fb:18-plus
    • fb:21-plus
    • fb:restricted-to
    • fb:visible-to-app-users
    • fb:visible-to-connection
    • fb:visible-to-friends
    • fb:visible-to-owner
  • Profile-specific
    • fb:action
    • fb:add-section-button
    • fb:if-section-not-added
    • fb:narrow
    • fb:publisher-link
    • fb:subtitle
    • fb:user-item
    • fb:user-table
    • fb:wide
  • Misc
    • fb:add-profile-tab
    • fb:fbml
    • fb:fbmlversion
    • fb:js-string
    • fb:page-admin-edit-header
    • fb:redirect
    • fb:ref
    • fb:serverFbml
    • fb:time
    • fb:title
  • Editor Display
    • fb:editor
    • fb:editor-button
    • fb:editor-buttonset
    • fb:editor-cancel
    • fb:editor-custom
    • fb:editor-date
    • fb:editor-divider
    • fb:editor-month
    • fb:editor-text
    • fb:editor-textarea
    • fb:editor-time
  • Embedded Media
    • fb:flv
    • fb:iframe
    • fb:mp3
    • fb:photo
    • fb:silverlight
    • fb:swf
  • Dialog
    • fb:dialog
    • fb:dialog-button
    • fb:dialog-content
    • fb:dialog-title
  • Additional Permissions
    • fb:prompt-permission
  • Social Plugins
    • fb:comments
    • fb:live-stream
  • Message Attachments
    • fb:attachment-preview
  • Forms
    • fb:captcha
    • fb:submit
  • Reference
    • JavaScript SDK

fb:comments

Advanced Topics › Legacy FBML › fb:comments
FBML has been deprecated. Starting June 1, 2012 FBML apps will no longer work as all FBML endpoints will be removed. If you are building a new application on Facebook.com, please implement your application using HTML, JavaScript and CSS. You can use our JavaScript SDK and Social Plugins to embedded many of the same social features available in FBML.

Displays a set of comments for a unique identifier. Facebook handles posting, drawing, and see all page.

The fb:comments tag is essentially a Wall for developers to drop on canvas pages and application tabs on profiles easily. Using the tag implies a Wall-like 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. The callbackurl defaults to the page where it was originally found, so the tag should work without any extra coding. However, you can point a callbackurl to a special page that can be more efficient.
    Note: If you render the fb:comments tag from FBJS using setInnerFBML(), you must set a callbackurl.
  • An fb_sig_xid parameter is passed to these pages. Facebook looks for this xid. You can use it to short-circuit your application logic and only output the fb:comments tag with the proper parameters.
  • When an action occurs, the page is also passed an fb_sig_xid_action parameter. Currently this can be "post" or "delete". If you return true for the action requested in the fb:comments tag, you can assume the action was performed.
    Note: Facebook redirects immediately to the same page again after passing the post to that page - but without the post information.
  • The refetch is in the form of a POST to the URL supplied in the callbackurl, mimicking a canvas page.
  • You can style fb:comments arbitrarily by using overriding styles and embedding CSS (or using link tags) as described in CSS Tips and Tricks. You can turn off the rounded-corners chrome by specifying the simple attribute below.
  • Comments can be published to a user's Feed only if the user checks Post comment to my Facebook profile. Previously, all comments would be published if developer set the 'publish_feed' parameter to true.
  • If you want to moderate comments before they get posted, set numposts to 0. This hides all comments. You can then use comments.get to retrieve all your comments and moderate or filter them as needed.

Parameters

NameTypeDescription
xidstring

The unique identifier for this set of comments. XIDs can contain alphanumeric characters (Aa-Zz, 0-9), hyphens (-), percent (%), period (.), and underscores (_) (in effect, the result of any urlencode can be a valid XID).

canpostbool

Indicates whether the viewing user can post on this comment set.

candeletebool

Indicates whether the viewing user can delete any post on this comment set. Any user visiting that user's profile where the comment appears can delete comments made to it (so, avoid using candelete unless this is the intended functionality).

numpostsint

The maximum number of posts to display. You can set numposts to 0 to not display any comments, for moderation purposes. Default value is 10

callbackurlstring

The URL to refetch this configuration. Default value is the current page
Note: If you render the fb:comments tag from FBJS using setInnerFBML(), you must set a callbackurl.

returnurlstring

The URL where the user is returned after selecting a "back" link. Default value is the current page

showformbool

Boolean whether to show the form (canpost "true" only) for inline posting. Posts using this form will not go to a see-all page after posting, but rather refresh the page.

send_notification_uidint

User ID to send a notification to upon someone posting a comment. (Only one uid allowed).

publish_feedbool

Indicates whether to publish a Feed story when the comment gets posted. The comment must be at least 5 words in length in order to be published to Feed.
Note: The comment can be published to a user's Feed only if the user checks Post comment to my Facebook profile.

simplebool

Removes the rounded box around the text area to allow greater customization.

reversebool

Changes the order of comments and comment area to allow greater customization.

Examples

<fb:comments xid="titans_comments" canpost="true" candelete="false" returnurl="http://apps.facebook.com/myapp/titans/">
<fb:title>Talk about the Titans</fb:title>
</fb:comments>
[[Fb:comments Snippet - Tracking comment count|Code Snippet - Tracking the Comment Count]]
Updated about 4 months ago
Facebook © 2012 · English (US)
AboutCareersPlatform PoliciesPrivacy Policy