How to add Facebook and Blogger Comments Box


The Facebook comments box is a convenient way to expand comment accessibility. Facebook has the largest base of users in the world and their reach continues to grow. Chances are readers have either a Facebook account or one Blogger accepts. In this article, I'll show you how to add Facebook comments along side Bloggers built in system.
Adding the Tabs
Let's begin by adding the Tabs HTML. Open your template in Design->Edit HTML and check Expand Widget Templates. At this time click on Download Full Template and save a copy of your template. This modification is significant and in case of an error installing, you may need this backup to restore your template. After backing up, search with Ctrl+F for class='comments'. Below this found line place the following code:


<div class='comments-tab' id='fb-comments' onclick='javascript:commentToggle(&quot;#fb-comments&quot;);' title='Comments made with Facebook'>
<img class='comments-tab-icon' src='http://static.ak.fbcdn.net/rsrc.php/v1/yH/r/eIpbnVKI9lR.png'/>
<fb:comments-count expr:href='data:post.url'/> Comments
</div>
<div class='comments-tab inactive-select-tab' id='blogger-comments' onclick='javascript:commentToggle(&quot;#blogger-comments&quot;);' title='Comments from Blogger'>
<img class='comments-tab-icon' src='http://www.blogger.com/img/icon_logo32.gif'/> <data:post.numComments/> Comments
</div><div class='clear'/>
</div>


Creating Tab Pages
Now that your tabs are in place, the comments must be segmented into 'pages' to be shown or hidden as a user chooses. Just after the Tab code I had you paste, insert this code:
   
<div class='comments-page' id='fb-comments-page'>
   <b:if cond='data:blog.pageType == &quot;item&quot;'>
   <div id='fb-root'/>
   <fb:comments expr:href='data:post.url' num_posts='2' width='400'/>
   </b:if>
   </div>
   <div class='comments comments-page' id='blogger-comments-page'>

This includes a 400px wide Facebook comments box and designates a page for blogger comments. You may change the 400 to whatever width suits your blog.

Tab Scripting and Styles
Two more additions remain to get things working properly. Once again open search with Ctrl+F and look for <head>. Below this line paste the following script:


<script src='http://connect.facebook.net/en_US/all.js#xfbml=1'/> 
<script src='http://code.jquery.com/jquery-latest.js'/>
<meta content='YOUR_FB_ID' property='fb:admins'/>
<script type='text/javascript'>
function commentToggle(selectTab) {
  $(".comments-tab").addClass("inactive-select-tab");
  $(selectTab).removeClass("inactive-select-tab");
  $(".comments-page").hide();
  $(selectTab + "-page").show();
}
</script>

These scripts are required to make the tabs function. If you already have another Facebook plug in or JQuery script included elsewhere, you may omit the first two lines. In order to gain moderation privledges to the comments, you must change the thrid line YOUR_FB_ID to your Facebook account ID. All that's left now are the Styles to make things look nice. Again search with Ctrl+F this time for #comments. Paste the following styles on the line above:


.comments-page {  background-color: #f2f2f2;}
#blogger-comments-page {  padding: 0px 5px;  display: none;}
.comments-tab { float: left; padding: 5px; margin-right: 3px; cursor: pointer; background-color: #f2f2f2;}
.comments-tab-icon { height: 14px;  width: auto;  margin-right: 3px;}
.comments-tab:hover { background-color: #eeeeee;}
.inactive-select-tab { background-color: #d1d1d1;}

You may choose to alter these styles to suit your blog, but all 6 should be included in some form. Save your changes and visit an individual post page. Posts should now have Facebook and Blogger Comments at the bottom with tabs to select your favored option. These will not appear on the main page, only individual post pages.

Conclusion
The Facebook Comments Box is an excellent way to give visitors choice in conversing with you while limiting anonymous spam. There's the added bonus of social exposure through visitors friends seeing the comments. Although, you cede some control over the comment storage to Facebook and future portability may be an issue. Still, I believe the potential for exposure and social interaction while maintaining the Blogger default option makes this an excellent choice.

I realize these install instructions are fairly extensive, it's the price we pay for tabbed comments unfortunately. You may reach me for assistance through any of the three comment options provided below. Thanks for reading and good luck with your blogging.

Enjoy!


6 comments:

Gulab Shah said...

i did everything as well as is it but it still wont showed the tab in my blog at all this is my site medialivecent.com

Cyrusholiday said...

Thanks for sharing. Its good to see fresh content always.
open source developer

harry said...

thanks
http://www.centplay.com/affiliate/affiliate_2210/

mahendran said...

cool thanks..-

GuildWars2Items said...

I love you not for the things you would bring to me but to accept everything you could bring Cheap Minecraft Gift Code, he true love is not for showing, but I am sure that even if all other people abandon me, you will still be my side Buy Xbox Live Points, I love you not because of who you are, but because of who I am when I am with you Ultimate Game Card


The consequences of today are determined by the actions of the past scarlet blade gold. To change your future, alter your decisions today scarlet blade gold, Experience is a hard teacher because she gives the test first, the lesson afterwards scarlet blade gold, but it takes character to keep you there.

jay sam said...

Google has strict its rules to cut down spamming and cut downing the website through Penguin and Panda updates. Now the website owner has become more conscience to avoid spamming his website for this purpose he must have back links in do follow shape on the relevant websites. http://colibritool.com/ is helping you to avoid spamming your website.

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Comments

Twitter Delicious Facebook Digg Favorites More