Fb:comments
From Facebook Developers Wiki
Contents |
[edit] 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 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
callbackurlsupplied. Thecallbackurldefaults to the page where it was originally found, so the tag should work without any extra coding. However, you can point acallbackurlto a special page that can be more efficient. - An
fb_sig_xidparameter is passed to these pages. Facebook looks for thisxid. 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_actionparameter. 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.
[edit] Attributes
| Required | Name | Type | Description | |
| required | xid | string | The unique identifier for this set of comments. Comments can contain alphanumeric characters (Aa-Zz, 0-9), | |
|---|---|---|---|---|
| canpost | bool | Indicates whether the viewing user can post on this comment set. | ||
| candelete | bool | Indicates whether the viewing user can delete any post on this comment set. | ||
| numposts | int | The maximum number of posts to display. | ||
| optional | callbackurl | string | The URL to refetch this configuration. (default value is the current page) | |
| returnurl | string | The URL where the user is returned after selecting a "back" link. (default value is the current page) | ||
| showform | bool | 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_uid | int | User ID to send a notification to upon someone posting a comment. (Only one uid allowed). |
[edit] 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> |
![]() |
| Code Snippet - Tracking the Comment Count |
[edit] Notes
This tag may contain fb:title.

