Last updated October 20, 2010. Created by MGParisi on January 2, 2008.
Edited by Dave Cohen, paskainos, techninja, NancyDru. Log in to edit this page.
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:
- The Drupal for Facebook project file from http://drupal.org/project/fb. Choose the version appropriate for your version of Drupal.
- The Facebook platform that is appropriate for the branch of Drupal for Facebook you are using.
- 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...
- If you are on the 3.X branch, use Facebook's php sdk here: http://github.com/facebook/php-sdk/downloads
Upload and Unpack
- Upload and unpack the FB module into /sites/all/modules directory on your server.
- While still in your server interface, open the FB module directory that was just created.
- 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', '&');
toini_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.
- DFF Facebook API - Imports and uses the Facebook API
- DFF Applications - Allows Drupal to host Facebook Applications
- DFF User Management - Create local accounts for users of Facebook Apps
- 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:
- DFF Canvas Pages - Support for Facebook Canvas Pages.
- 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...
Comments
The Facebook platform url is not working
The Facebook platform url (http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platf...) is not working. Please help me on this issue
you can get the facebook.php
you can get the facebook.php from here: http://github.com/facebook/php-sdk
Update
I don't think it's the same thing. After a few tests it's not working...
Client Library Incompatibility
It looks like the newest client library does not have get_loggedin_user() function in Facebook class..Please advise
It has been moved to github
For v2.x use http://github.com/facebook/platform/raw/master/clients/packages/facebook... as the ammended instructions above state. Do note that the platform on that link was last updated on April 2009.
Recommended one would be the other - php-sdk - but support for that is only available for v3.x of dff which is still in dev.
------
Con paciencia y calma,
sube un burro a una palma
Relief 2.0 - http://www.relief20.com
Navidad Latina - http://www.navidadlatina.com
If we add fb_settings.inc to
If we add fb_settings.inc to our settings.php ¿why don't add
ini_set('arg_separator.output', '&');to this file?How to gather other languages libraries
I am trying to traduce components to Spanish, traductions are gathered thru a couple of libraries, this is one:
http://static.ak.connect.facebook.com/connect.php/en_US/css/bookmark-but...
How can I change this link to point to the appropiate library for my site. This means change localization directory from en_US to es_LA in my case.
Diseño Web
i18n help neeeded
I'd love some help internationalizing Drupal for Facebook. I haven't had to build an app in languages other than english, yet. Probably a couple small patch would be enough, but I don't know the exact changes to make.
If you can find any places in Drupal for Facebook that create a facebook.com/... url that is not properly internationalized, you should point them out in the issue queue. If you can provide a patch, that would be even better.
Internationalization
Happy to help, all we need is to locate where are the scripts that generate the code that insert tags on the head of the Drupal page.
Then we can patch to change the directory to specific language from Drupal.
Diseño Web
Activate the FB module(s) before activating theme
The theme fb_fbml has some function calls referring to the fb modules and causes a Fatal Error if activated before the module(s). In reterospect, I probably shouldn't have set it as the default theme :o - Thank goodness for drush!
I've added a note indicating
I've added a note indicating that the fb_fbml theme should be used only with the 2.x branch of Drupal for Facebook, and not the 3.x branch.
no such file...
ok, so the directions above says:
require_once "sites/all/modules/fb/fb_settings.inc";
however that path does not exist nor does the file. I am working with V2 and have downloaded the package which includes two directories.
The module directory is fbconnect not fb, so the path above is not valid. Also there is no fb_settings.inc. Where can I find it???
AAARRRRRG!
James Welsh
_____________________________
Web Solution Architect
Conscious Web Solutions
http://www.ConsciousWebSolutions.com
that's another module
Either download and install module/fb, or seek help from the fbconnect module. They are not the same thing.
Facebook client library - path/directory
Note, the current fb module (v 1.97 2010/08/19) looks for the facebook php sdk in "sites/all/libraries", not in "sites/all/modules/fb" as indicated by the instructions on this page. However, this is explained properly in the "README.txt" file, included with the fb module.