Name

<fb:comments/>

Synopsis

<fb:comments xid="..." canpost="..." candelete="..." numposts="...">...
    </fb:comments>

Similar to the <fb:board/> tag (described earlier in this chapter), this tag creates a Wall-like component that users can comment on. The data for these <fb:comments/> blocks is not available to the developer and is controlled by Facebook. It provides an easy way for your users to make comments.

FBML-Specific Attributes

Required

xid=[string] default: none

The unique identifier for this comments block. Each post within the series of posting comments will reference this identifier.

canpost=[true|false] default: none

If true, any viewing user can post to the comments.

candelete=[true|false] default: none

If true, any viewing user can delete comments.

numposts=[int] default: none

The total number of posts visible when the page loads. The “See All” link allows the user to still see all posts.

Optional

callbackurl=[string] default: the current page

The URL that Facebook references to identify the source of the current comments block.

returnurl=[string] default: the current page

The URL to take the user to after the user clicks the “Return” link.

showform=[true|false] default: true

If true, shows the form block below the comments on the first page of the comments. The user will not have to click the “See All” link to add a comment this way.

send_notification_id=[int] default: none

The ID of the user to send notifications to when comments are made for the current comment block.

Example FBML

The following example FBML generates a simple comments block for the “Hello Friends” example in Chapter 1 (Figure 3-52 shows the result):

<div style="width:300px">
<fb:comments xid="hello_friends_comments" canpost="true" candelete="false" 
    returnurl="http://apps.facebook.com/fbmlessentials/">
  <fb:title>Comments for Hello Friends Example</fb:title>
</fb:comments>
</div>
The resulting comments block from our <fb:comments/> example
Figure 3-52. The resulting comments block from our <fb:comments/> example

Additional Information

  • You can add more than one <fb:comments/> on a single page. Just specify different xids for each <fb:comments/> block.

  • To specify a width for your <fb:comments/> block, wrap it in a styled <div/>.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.27.74