How to create Profile Tab content?
| Project: | Drupal for Facebook |
| Version: | 5.x-2.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I have successfully created an app by mapping an existing Drupal node as the canvas page, and this content is visible at http://apps.facebook.com//. So far, so good. When I add the app to a Facebook Page (not a user profile), I would like the ability to add it as a Profile Tab. I see that in the Developer section for the App, I can enter a Tab page URL by appending a page name to the canvas page URL like so:
http://apps.facebook.com//. My question is - how do I create that Tab page name on the Drupal side and associate it with the canvas page node? Or better yet, how to make the canvas page content and the Tab page content the same? How would one specify the Tab page name on the Facebook side?
Thanks for any help...

#1
I would like to know this as well ... strange that nobody have suggestions ... is the "Drupal for Facebook" modul already dead?
#2
considering it was updated as early as July 30 2009, I'd say it isn't dead. Check CVS messages.
There is documentation here: http://drupal.org/node/195035
and the module is still in heavy development, which may mean you have to fly solo until such time as the maintainer/s stablize the code.
#3
Canvas pages can have many URLs. For example, apps.facebook.com/APPLICATION/node/123 might be a canvas page, and apps.facebook.com/foo/bar might be another URL. But profile tabs you have to tell facebook in advance what that URL is. So typically, you'd define a menu callback or view or whatever in Drupal. Then configure the app on facebook to hit that URL for the canvas tab.
there's one important difference between a profile tab versus a canvas page. Profile tabs cannot redirect. This has some implications in Drupal. For example sometimes drupal builds part of a page as if a user is not logged in, then discovers they are logged in and redirects. Without the redirect, some menus are built as if the user is not logged in. So, if your profile tab exhibits some weird behavior this may be why.
This project is far from dead. But its also not perfect. If profile tabs are not working as expected, jump on board and solve the problem.
Also I recommend upgrading to the 6.x version. I don't plan to add features to 5.x.
#4
Thanks for the reply, but i didn't find anything about profile tabs in the documentation.
I have a working facebook application (fbml canvas) using "drupal for facebook" and would like to have the same content on the profile tab. I already discovered the problem mentioned above, that redirects are not allowed for profile tabs, but I don't understand the whole concept to find a answer by myself.
Somebody can make an example or description, which tasks have to be done to have the same canvas page as a profile tab?
#5
i did this and it works. But maybe this is a different case.
i made a profile tab which shows some user content:
Make a view. and choose and argument lets say user id,( rename user id url with Pathauto module) then using embeded views paste that php view code inside a node page ) ex : node/123
then grab the argument from the facebook url . and past it to the embedded view
. let me know if i make my self clear,
#6
As far as Drupal is concerned, the profile tab is just a page that it renders in an FBML theme. Drupal for Facebook modules and theme take care of most of this. You just have to tell facebook which URL to request. The form (in the facebook developer's app, under "Profiles") will ask you for the URL (starting with apps.facebook.com/YOURAPP/).
If you have the fb_devel.module installed (which you should until things are working perfectly), try 'fb/devel' for the Tab URL. Then add the tab to your profile on facebook and you'll see some debug output.
Of course you'll want to change the Tab URL to some page that looks better than fb/devel. That takes Drupal know how. Maybe its a View or a node.
On my todo list is a way to make the facebook user id of the profile be a relationship in views. In other words a way to use views to make a page specific to the user who's tab you're visiting. But right now you need some PHP code to accomplish that.
#7
dave would you care to release that code to make the tab page specific to the user's page?
if it includes something basic, like outputting the fb page owner's name, i'm wondering if that would be useful for a comment module hack (which posts the fb uid, not their name).
cheers!