I can't get my canvas page to trigger the FBML theme.

I've resisted posting a support request on this because it should be something I can figure out. But after reading through README.txt and all other documentation I can find, including related items in the issue queue (multiple times!), I'm still coming up blank for an answer.

Here is my canvas page: http://apps.facebook.com/wate-headlines/. Here is the content on my dev site that should be displayed: http://fb6.dev3.webenabled.net/latest-headlines.

When I set the page to display as FBML, I get an error message saying "illegal tag 'body' under 'fb:canvas'."

When I set the page to display as an Iframe, I get an an Iframe. This is not, however, showing up resized. It has scrollbars, so that also might offer a clue.

As you can see in my tag, I've included the call to FB:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" xmlns:fb="http://www.facebook.com/2008/fbml">

Here is the last part of my settings.php file:

<?php 
if (!is_array($conf))
  $conf = array();

$conf['fb_verbose'] = TRUE; // debug output
$conf['fb_api_file'] = 'sites/all/libraries/facebook-php-sdk/src/facebook.php';
$conf['fb_apikey'] = ' [ my api key goes here ] '; 
include "sites/all/modules/fb/fb_settings.inc";
$conf['session_inc'] = "sites/all/modules/fb/fb_session.inc";
?>

I confirmed that the fb_fbml theme is in my theme folder. I even moved it from /sites/all/themes to /themes to see if that made a difference, but it didn't. I also confirmed that the fb_fbml theme is selected as the canvas page theme in the module settings.

I tried resetting the module's weight, as suggested here -- http://drupal.org/node/187868#comment-784309 -- but that didn't fix the problem either.

I must be missing something, but I can't see what it would be. Is it a setting in the FB's app administration pages, maybe?

Comments

Dave Cohen’s picture

Status: Active » Closed (works as designed)

In 3.x I've removed support for FBML canvas pages, because facebook has deprecated that approach. There is no fb_fbml theme compatible with 3.x. You should make the app iframe instead, and use a theme that fits the 760 pixel limit.

In facebook's old libs, there was a way to automatically resize an iframe so it always fits without scrollbars. In the new libs they simply left that feature out. For the time being, if you want iframes to automatically resize, you're stuck with the 2.x libs. With the new libs, the closest I was able to get was the gross hack in this thread: http://forum.developers.facebook.com/viewtopic.php?id=56736

All that said, it has come to my attention that Profile Tabs must be written in FBML, even though facebook has deprecated the use of FBML in all other cases. So I may have to re-introduce some FBML support for that one case. (Still mulling that over, not sure how best to do it)

Dave Cohen’s picture

Just saw a report that facebook is now supporting the auto-resize in iframes. I'll try to get that working later this week.

jimsmith’s picture

Thank you, Dave. I'm glad to know I wasn't going crazy.

And thanks for your efforts with this well-conceived and thorough set of modules. I'm certain it's not easy keeping up with this project because you're forced to follow a moving target.

jimsmith’s picture

All that said, it has come to my attention that Profile Tabs must be written in FBML, even though facebook has deprecated the use of FBML in all other cases. So I may have to re-introduce some FBML support for that one case. (Still mulling that over, not sure how best to do it)

When you brought up the subject of profile tabs, I hadn't gotten that far in my setup. Now that I have, I find myself stumped again.

I've got my canvas page set as an iFrame now and it displays just fine if you go to the standalone page, http://apps.facebook.com/wate-headlines/. That doesn't do me much good, though, because a tab is needed on a Facebook page so people can reach it.

From what you're saying and from what I've observed, adding a profile tab requires FBML. It seems, though, that I don't have any way to trigger an FBML template. The tabbed page displays a message saying "illegal tag 'body' under 'fb:tab-position'."

Have I got this, right?

Dave Cohen’s picture

That is where things stand for the moment.

You could write a menu callback that returns FBML. Or find some way to set $GLOBALS['custom_theme'] to an FBML theme, when producing a profile tab. I was too quick to remove FBML from 3.x, because I thought it was not necessary any more. And I dread working too hard to support it, because I suspect facebook will change this requirement before long.

jimsmith’s picture

Actually, it looks like I've solved this problem, at least for the time being.

I used the themekey module. The FBML theme from version 6.x-2.x is picked up by themekey when I set it to switch the theme by path.

As you say, things will probably change, but at least for now I haven't needed to write a new module.