How do I add a Facebook "Like Box" Plugin to my page?

The Like Box plugin, supplied by Facebook, allows web page contributors to embed a live stream of their Facebook page into a webpage.  Additionally, audience members can then choose to "Like" the stream topic.

This plug-in can be found by visiting the Facebook Like Box web page, which is part of the Facebook Social Media Plugins collection.

Adding a Like Box to your web page, Drupal node, or Drupal block is really simple.  Just follow the steps below:

  1. Copy the URL of the Facebook page you would like to embed.
  2. Go to the Facebook Like Box page at http://developers.facebook.com/docs/reference/plugins/like-box.
  3. Paste the URL into the Facebook Page URL field
  4. Make any other desired configurations in the provided options.
  5. Click the Get Code button.  This will produce a dialog box that contains some iframe code that you can embed on your page.
  6. Copy the iframe code from dialog box and take it over to the Drupal page you wish to embed the code in.  Make sure your Drupal page is in Edit mode.
  7. Change the Input Format of the text editor to PHP - this must be done before pasting in any code.
  8. Add any other HTML that you desire outside of the iframe tags. 
    1. Remember, when using the PHP Input Format, if you want to add additional HTML, you will have to add the tags yourself. 
    2. Using any other input format other than PHP will completely strip the PHP code from the text editor and it will not be automatically replaced if you toggle back.
  9. Click the Save button.

Your new Like Box embed should pop right into view and be ready for some interaction.

See Also: