Enabling Facebook Comments in Web Pages

Commenting on Our Website with a Facebook Account

Comments are frequently used to provide user interaction with the content on our web page. While we can provide the identity verification of the user while commenting on our page, we can provide it with our own membership system, as well as with Facebook accounts. And by doing this very easily.

http://developers.facebook.com/docs/reference/plugins/comments Using this site we can customize the form to be used to comment here.

We enter information such as the url of our page where the comment form will be used, the width of the form, and how many comments will be shown at the same time.

After we are done, we copy the necessary codes and paste them to the relevant places on our page by saying Get Code.

The given code consists of two parts.

1. Code snippet:

<div id="fb-root"></div>

<script>(function(d, s, id) {

  var js, fjs = d.getElementsByTagName(s)[0];

  if (d.getElementById(id)) return;

  js = d.createElement(s); js.id = id;

  js.src = "//connect.facebook.net/tr_TR/sdk.js#xfbml=1&version=v2.8";

  fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));</script>

 

We paste the above codes right after the opening of the body tag of our page.

2. Code snippet:

<div class="fb-comments" data-href="sayfaUrlniz" data-numposts="5"></div>

We paste these codes where we want the comment form to appear. The address of your page will be written in the place where your pageUrl is written, starting with http://.

Performing the above operations is sufficient to add facebook comments to our site. With this method, we can add facebook comments to many pages on our site. The data-href parameter will be set differently on each page, facebook will store the comments of each page separately.

Managing Facebook Comments in Our Site and Receive Notifications

We do not receive any notifications when a user comments using the comment form on our page. We can use two methods to receive notifications about comments, review statistics, and manage comments.

Both methods are very easy and only one of the two methods should be chosen. Using both will cause problems.

a. Associate With Facebook App

This is the recommended method. https://developers.facebook.com/apps/ You can easily create a facebook application by going to this address. Using this application, you can also perform different operations such as logging in to your site with facebook.

You can easily create your application by following the steps. Then you will be given the facebook application code (App Id).

When you paste the meta tag on all the pages where the comments are published, by replacing this code with the applicationCode below, your application will be associated with the comments on those pages.

<meta property="fb:app_id" content="appCode" />

b. Adding a Moderator (Admin) for Comments

We can make one or more Facebook users admins for comments without using the app. The meta line this time will be:

<meta property="fb:admins" content="usercode"/>

The place where the userCode is written above should be replaced with the Facebook Id of the person to be admin.

Comment Moderation Tool

If you have followed one of the steps above, you can go to https://developers.facebook.com/tools/comments/ to see, approve, hide comments made on your pages, and report and block comments as spam.

 

enable facebook comments in web page, adding facebook comments to the web page, showing comments on the web page with facebook account, users commenting on our site with their facebook accounts

EXERCISES

There are no examples related to this subject.



COMMENTS




Read 805 times.

Online Users: 11530



enabling-facebook-comments-in-webpages