Friday 9 November 2012

FACEBOOK: Comment Boxes for your site powered by facebook.

The facebook comment social plugin is an excellent way to boost up the social experience of people on your website. It lets them comment on posts on your website using their facebook account.

Find out more:
This is how you get to integrate facebook comments to your website:
Include the javascript SDK in the web page:(You don't need to do this if you've already included it for other social plugins like the 'like' button.

<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/en_US/all.js#xfbml=1&appId="
your app id";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


Replace 'your app id' with your facebook app ID.
Dont have one? SEE:Create your app.


Include this code in the place where you want comment box to appear:


<div class="fb-comments" data-href="your URL" data-num-posts="4" data-width="470"></div>


Replace "your URL" with your URL. eg. http://example.com.

That's it! You just moved a step ahead in taking your website social! 

DEMO: Comment here:


#code { border: 3px dashed black; padding: 10px; }

No comments:

Post a Comment