Advertising sustains the DA. Ads are hidden for members. Join today

Installation and Setup

This document is for the modules/fb 2.x release. It is recommended you upgrade to modules/fb 3.x.

The installation of Drupal for FB is not your typical Drupal process so please pay close attention to the steps below.

Download

You will need to download two files:

  1. The Drupal for Facebook project file from http://drupal.org/project/fb. Choose the version appropriate for your version of Drupal.
  2. The Facebook platform that is appropriate for the branch of Drupal for Facebook you are using.
    1. If you are using the 2.x branch of Drupal for Facebook download the REST api libraries here: http://github.com/facebook/platform/raw/master/clients/packages/facebook...
    2. If you are on the 3.X branch, use Facebook's php sdk here: http://github.com/facebook/php-sdk/downloads

Upload and Unpack

  1. Upload and unpack the FB module into /sites/all/modules directory on your server.
  2. While still in your server interface, open the FB module directory that was just created.
  3. Upload and unpack the Facebook platform (facebook-platform.tar.gz) in the FB module directory.

Configure your Settings.php file

Go to /sites/yoursitedirectory and open your settings.php file. Scroll to the bottom and paste the following:

require_once "sites/all/modules/fb/fb_settings.inc";

NOTE: If you have installed the fb module in a different directory from "sites/all/modules," then specify the correct directory name in the "require_once" statement above.

Important: Facebook client libraries will not work properly if arg_separator.output is not &. The default value is &. Change this in settings.php. Change the line:
ini_set('arg_separator.output', '&');
to
ini_set('arg_separator.output', '&');

Canvas Page-Specific Setup

Canvas Pages come in two flavors, FBML which uses special markup unique to Facebook, and iframe which makes the canvas an iframe served directly from your server. Facebook has deprecated the use of FBML canvas pages, so using iframes is recommended.

In either case, you will want a theme for canvas pages which is different from your default and admin themes. This theme should visually go well with the header and footer which Facebook attaches to all canvas pages. And it must fit in the limited width of a canvas page (760px for canvas pages, 520px for profile tabs).

Enable the FBML Theme

If using FBML, you can use the fb_fbml theme as a starter. You may want to customize it for your particular application. Remember FBML is now deprecated so this is not recommended. The fb_fbml theme is available in the 2.x branch of Drupal for Facebook, but not the 3.x (use iframe instead!)

Open the FB module themes directory (/sites/all/modules/fb/themes) and copy the fb_fbml directory to /sites/all/themes.

Go to admin > site building > themes and enable the fb_fbml theme and save the changes.

Enable the Drupal for Facebook Modules

Drupal for Facebook comes with several modules. Not all are required. Which ones you enable depends on which features your application supports.

Enable Required Modules

Only the most advanced users will choose not to enable the following.

  1. DFF Facebook API - Imports and uses the Facebook API
  2. DFF Applications - Allows Drupal to host Facebook Applications
  3. DFF User Management - Create local accounts for users of Facebook Apps
  4. DFF Devel - Blocks and messages that help when developing and debugging Apps. This will help for troubleshooting. To enable this, you need the Devel module. Use only on your development install, not on your production install.

And at least one more...

Also enable one (or both) of the following modules, depending on whether you are building Facebook Connect pages or Canvas pages:

  1. DFF Canvas Pages - Support for Facebook Canvas Pages.
  2. DFF Connect - Login to Drupal with Facebook username and password, and other fbConnect features.

Permissions

Go to admin > user management > permissions and give your role permission to administer, create, and edit FB applications. It is assumed that your role is an admin role and you have permission to do this.

Applications

Now, you can configure one or more applications, as described on the next page...