Topic-icon Is there a way to add the canvas app to a FB page?

Active Subscriptions:

None
I can't stand the Page Tab 810px view. I love the wide canvas view from the app. So I have been trying to add the app to its own FB page and get rid of the Page Tab, but I can't seem to do it. I think actually FB doesn't want us doing this, since when I access the app when using FB as my page, it says I must change to myself to be able to see the app. But if I'm myself then I can't add the app to the FB page.

Does anyone know of a workaround to get a canvas app displaying on its own FB page?
The topic has been locked.
Support Specialist
13 years 9 months ago #25955 by alzander
Ludwig,
Sorry for the delay in getting back to this! We agree, the 810px view can be.. annoying. It's much, much better than the old 520px view they had until earlier this year though!

If you want to redirect from the Page Tab to the Canvas, it's likely not that difficult, but will require a code change. Please open up the /components/com_jfbconnect/libraries/canvas.php file to edit. Around line 161, you'll see the following block of code:
else
        {
            $tabTemplate = $this->configModel->getSetting('canvas_tab_template');
            $this->setTemplate($tabTemplate);
        }
Change that to:
else
        {
            echo "<html><head></head><body><script type='text/javascript'>top.location.href='http://apps.facebook.com/your-canvas-url'</script></body></html>";
            $app->close();
            $tabTemplate = $this->configModel->getSetting('canvas_tab_template');
            $this->setTemplate($tabTemplate);
        }
That should redirect the user to your Canvas area. Honestly, you could redirect to any page, but I'd recommend staying 'within' Facebook just to be safe. Not sure what their terms of service say about redirecting away from the Page Tab. I'm sure they'll be much more comfortable if you just go to your App though.

The code above is untested, but we use the same code for our Requests to redirect the user to your site. So, it should work, but let us know if you run into issues!

Thanks, and good luck,
Alex
The topic has been locked.