Not long ago facebook introduced iframe-based page tabs, as opposed to the older FBML-based tabs. The FBML tabs are now deprecated, but until now are the only kind supported by modules/fb/fb_tab.module.
While I dread including large changes and new features in release candidates, which the fb-6.x-3.0 release is supposed to be, I'm seriously considering including this new feature. Without it, there is essentially no support for page tabs, which I think are important.
So here's a massive patch which may or may not make it into the 6.x-dev branch next week. Please test if you can and weigh in as to whether this feature is important to you.
My personal recommendation, if your app needs a tab, is to use this patch and build an iframe tab, as opposed to FBML.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | diff2.diff | 31.78 KB | Dave Cohen |
| #4 | fb_tab_iframe.diff | 31.88 KB | Dave Cohen |
| fb_tab_iframe.diff | 26.99 KB | Dave Cohen |
Comments
Comment #1
jackplain commentedThanks a lot!
The "iframe Tab" feature is very important for application development.
I got a fatal error after patching.
Fatal error: Call to undefined function fb_process() in ../sites/all/modules/fb/fb_tab.module on line 166
I can't find the file "fb.process.inc", which is supposed to be included in fb_tab.module
Comment #2
Damjan Dvorsek commentedAfter patching also in my case something is very wrong. If i go to application, or the page tab, the canvas is balnk and the tab also. Unfortunatly I don't get any error reported, so I can't say where exactly is the problem.
Comment #3
Damjan Dvorsek commentedOk I check recent log again and I get the following errors reported when I go to application in FB
include_once() [function.include]: Failed opening 'sites/all/modules/fb/fb.process.inc' for inclusion (include_path='.:/opt/bitnami/php/lib/php') in /opt/bitnami/apps/drupal/htdocs/sites/all/modules/fb/fb_canvas.module on line 171.
and similar
include_once(sites/all/modules/fb/fb.process.inc) [function.include-once]: failed to open stream: No such file or directory in /opt/bitnami/apps/drupal/htdocs/sites/all/modules/fb/fb_canvas.module on line 171
and the error massages when I visit the application tab on a page
include_once() [function.include]: Failed opening 'sites/all/modules/fb/fb.process.inc' for inclusion (include_path='.:/opt/bitnami/php/lib/php') in /opt/bitnami/apps/drupal/htdocs/sites/all/modules/fb/fb_tab.module on line 155.
and similar
include_once(sites/all/modules/fb/fb.process.inc) [function.include-once]: failed to open stream: No such file or directory in /opt/bitnami/apps/drupal/htdocs/sites/all/modules/fb/fb_tab.module on line 155.
Comment #4
Dave Cohen commentedHere's another attempt to roll the patch. Hopefully this will include the new files (fb.process.inc and fb_tab.js).
Comment #5
Dave Cohen commentedHere's another attempt to roll the patch.
Comment #6
Damjan Dvorsek commentedThe diff2.diff looks ok, haven't noticed any issues so far.
It fixes my problem http://drupal.org/node/1118238
Thanks
Comment #7
Dave Cohen commentedFYI, plan is to get this into D6 branch first, as the 3.0-6.x release is the priority. Will port to D7 after.
Comment #8
Michsk commentedThe autoheight does not work for the tab pages.
See http://forum.developers.facebook.net/viewtopic.php?id=91526 for more info about tab pages and autoheight.
Comment #9
Michsk commentedfb.module @553 add:
Comment #10
Dave Cohen commentedJust add
to the
<body>tag of your tab theme's page.tpl.php. See fb_tab.js for how that is handled.Don't redifine window.fbAsyncInit as it is already defined in fb.js.
Comment #11
Michsk commentedOk but i use the same page.tpl for tabs and pages, trough a fluid layout.
Is there some way to do a check, i use a custom template for the fb-stuff so i can change everything without altering the website itself. Here you can see what i've done so far with your module http://www.facebook.com/pages/Depressie/115925068466757?sk=app_148285918...
Or can i also add fb_tab-resizable for fb-pages and it will not break anything?
Comment #12
Michsk commentedsorry for taking of this thread, if you want i will create a new thread. Using fb_tab-resizable doesnt resize the iframe.
Comment #13
Michsk commentedResize is fixed. Thanks.
Comment #14
berenddeboer commentedAh, D6 only? That's a pity, as I'm developing a tab with Drupal 7. Any chance of a D7 port soon? Would this be hard to do (i.e. is the code very different, or is it just fiddling with api changes)?
Comment #15
Dave Cohen commentedMy goal is to get the D6 version, 6.x-3.0, released first. Then a D7 version will follow. Any help upgrading the 6.x modules is appreciated.
marking this as fixed for D6, but flagging that it needs to be ported to D7.
Comment #16
star-szrSubscribe
Comment #17
trevorsheridan commentedSubscribe
Comment #18
brettev commentedSubscribing
Comment #19
brettev commentedAfter subscribing, I have a question about ultimate functionality here. It looks like from other discussions, as well as other apps, that the tabs are supposed to be single pages. The app I'd like to build would be essentially a canvas page, but have it be within a tab, so we maintain the left navigation items of a fan page. I've attempted to do this with just pointing my app's tab url to the fb_cb/APPID url, but then some of the redirects and links go over to the app's canvas page, which loses the nav.
Is the end product of having iframe tabs going to allow me to control links and keep them within the tab of the fan page, or is there another way to handle a site within a tab of an iframe, keeping the links so they don't bounce to the app's canvas page?
I know we could probably just create a separate site that has a 520px wide theme, but we'd like to have the only difference between the tab and the site be the theme, so the same menu items and features are available on the site as well as the fb tab.
Hopefully this isn't too winded. Any direction here would be great! Thanks in advance!
Comment #20
Michsk commentedyour question should be a new issue.
Comment #21
gagarine commentedWhat's up with the port to D7?