How to add Facebook Like button to Drupal Website?

Drupal is a popular and stable framework to build your website. If you have been using Drupal for a while I am sure you like it and it does save time in building your web content instead of creating your website from scratch. Having a website is one thing and making it popular is another big essential effort. To bring traffic to your website you need to explore all the options available out there. Social Networking is a key tool in making your website popular. Facebook which is so extremely popular is definitely a good tool to market your website for free. You can do it by letting your facebook friends to recommend your website. You can do that using the Facebook Like button which lets facebook users to like your website and also share it with their friends.

How can you add the Facebook Like button to your Drupal Website?

How to add the Facebook Like Button to every Drupal Node?

You will need the following code:

<iframe id="iframe_like" name="fbLikeIFrame_0" class="social-iframe" scrolling="no" frameborder="0" src="http://www.facebook.com/widgets/like.php?width=100&amp;show_faces=1&amp;... $curr_url = check_plain("http://" .$_SERVER['HTTP_HOST'] .$node_url); echo $curr_url; ?>" width="100%" height="30"></iframe>

 

Here let us see how to do it Step by Step.

Step 1:  Copy the above code

Step 2: Open your node.tpl.php file in notepad. You should find this file under your current themes folder  ( <root>/themes/<your current theme name>)

Step 3: Paste the above code between  <div class="content"> and <?php print $content ?>

Step 4: Save the file and upload it to your server. You are done.

Now you should have the Facebook Like button in every post of your Drupal website.

Hope that was helpful!