• Home
  • Clients
  • Social Web Design
  • Social Strategy Guidance
  • Managed Services
  • Partners
  • About
    • Tim Miner
    • Jessica Ziegler
  • Blog
  • PostsComments

Vestor Logic

Designing websites and strategies for the social web

  • Web Design Portfolio
  • Our Clients
You are here: Home / Social Media / Facebook / Facebook: Convert your Static FMBL to iFrame – It’s not as painful as you think!

Facebook: Convert your Static FMBL to iFrame – It’s not as painful as you think!

February 21, 2011 by Jessica Ziegler

Facebook recently put into action the long anticipated change from Static FBML to iFrames, requiring all new custom content on Facebook Fan pages to be built as a Facebook iFrame application.

This new update will be forced though on March 11th but you can (and should) get a jump on it now. This is actually a really good thing for Page owners and developers. It means that you can use standard html, css and javascript becuase your content will be calling a page directly from your site. You will still need to plan and build for the limitations of 520×720, the depth/height limitation is new, but you can figure ways to work with it).

The previous Tabs we are all used to will be gone, but you could create your own tabs within your 520×720 framework, if you want a more multi-page feel (check out Trailsherpa’s facebook page here to see how I solved for that). Again, this is a great thing because you will have full control over the length, appearance and style of those tabs.

Alright so how do we do this thing?

I create and implement your new iFrame app you’ll need to do 3 things:

1)      Create a Facebook iFrame application and associate it with your Fan Page

2)      Create a PHP page on your website that you will call from your iFrame application

3)      Upload that PHP page and its related assets

Step 1: Create a Facebook iFrame application and associate it with your Fan Page:

1)      Login to Facebook and go to http://www.facebook.com/developers/createapp.php to create your new app

a.       Give your application a name (this name will not appear on your Fan Page) and agree to terms

2)      Add an icon and or logo, contact email and privacy policy links (if you don’t have those policies, just link to the main page of your site). Add an icon, it will show up next to your app in the left nav of your Fan page. The logo is more for if you intent to share this app with others (think Farmville). Save changes.

3)  On the Website Tab, add your site url (not actually neccesary).

4) Go to the Facebook Integration tab. This is where things get mildly complicated.

a.       For Canvas Page select a folder that makes sense as the base url for your application. This will need to be DIFFERENT for each application you create and can only contain lowercase letters, dashes, and underscores.

b.      Canvas URL: this is going to be the FOLDER on your site where you create your PHP page and its related assets. MUST HAVE TRAILING SLASH (i.e. be a folder).

c.       Select iFrame and autoresize (not that it will resize) or show scrollbar if you have a page deeper than 720. They are pretty unpleasant looking, avoid them if you can.

5)      Scroll down to Page tabs at the bottom.

a.       Create a page name, limited to 16 characters. This is the name that will appear on your fan page as a link on the left and at the top of the iFrame “page” .

b.      Tab url: this is the actual page that you will be calling for the iFrame content. Where is says CANVAS_URL, once you save that will change to the name of the folder you designated above. This page can be called whatever you want, as long as it’s .php (.html will not work). So in effect, based on my current inputs, my new iframe content will be pulled from: http://www.vestorlogic.com/my_awesome_app_folder/index.php.

c.       Save changes. Your app is set up!

6)      You are now on your applications main edit page. Associate your new application with a Fan Page

a.       Click the “Application Profile Page” link on the right.

b.      Now you are on your apps public page, click “Add to My Page” from the left nav. This will bring up all the pages you admin. Select the correct one and add it.

That’s it for the Facebook integration!

STEP 2: Create a PHP page on your website that you will call from your iFrame application

1)      This is where things get a lot more standard. You’ll want to create a page on your site in the folder that you designated in your app. In mine it was: http://www.vestorlogic.com/my_awesome_app_folder/index.php.

2)      If you already have a Static FBML tab, you can go to that tab, copy the code and paste that into a new .php file, save and upload. In the above example my file would need to be called index.php and it would need to live in the “my_awesome_app_folder”  folder.

STEP 3: Don’t forget to upload this page and its related assets!

Now you will see your new app listed as a link on the left nav of the fan page you related it to. You can see ours here.

See that little Welcome link on the left with the icon? Awesome!

Special shout out to Paul Kortman’s great post that helped me figure it out.

Filed Under: Facebook, Featured, Social Media Tagged With: create a facebook iFrame app, facebook fan page, Facebook iFrame application, facebook tab, iframe app, iFrames, static fbml, static fbml to iframe
  • Ryan

    This is great info, thanks Jessica! I wasn’t aware that Facebook now allows iFrames in tabs (let alone will require it!). I write many Flash apps in tabs which, because of FBML, were limited (they weren’t allow to run javascript, contact other servers, etc.). Any idea how apps that require user authorization will work (for example, an app that needs the user’s list of friends) ? Time to test it out..

    BTW – It seems a little messy to still have a Canvas URL hanging around which you’ll never use if you’re only creating a tab. It could confuse people if they should ever happen to find it: http://apps.facebook.com/vestorlogic/

    • http://Vestorlogic.com Jessica Ziegler

      Thanks! I think that any user auths that have worked previously with iFrames will continue to work the same way, iFrames have been around for quite some time, there should be good documentation out there (I hope!)

      I agree, that canvas page is messy! Also some of the language should change in the process; like mentions of tabs.The “tabs” as they exist now are totally disappearing.

      • Ryan

        Well, after several hours of banging my head on my keyboard (a normal activity while fb programming), this is what I’ve come up with…

        In order to get permission from a user (to do things like get a friends list, post on the their wall, etc), you need to redirect the user to the Request for Permissions page (“getLoginUrl()” in PHP). When you do this, you also tell Facebook what page the user should return to after accepting. Unfortunately fb won’t take the tab’s URL (because that URL isn’t ‘owned by the app’), so you need to give it your canvas URL. BUT, on the Canvas, you can redirect the user back to the tab URL. BTW Jessica, for your app’s canvas page, you could put a line of js (top.location.href) to redirect users to your Welcome tab.

        Anyhow, the above is kind of hacky, but it seems to work. Also, Facebook might not like this because I don’t think there’s a way for a user to “remove an app” without being able to land on the app canvas page.

        If you want to check out my test, click the the “test” tab/link on the left side of this page:

        http://www.facebook.com/pages/Label-Interactive/131941363541204

        • http://Vestorlogic.com Jessica Ziegler

          Very nice, thanks!

          I tried the top.location.href, which does redirect to the facebook canvas, BUT then the iframe tries to load over and over. I’m going to have to hunt around for a trick!

  • Anonymous

    Great post

    How did you turn your app page into your FB “home page”?

    For example, my default home page is the wall – I simply cannot figure our how to change this…

    • http://www.VestorLogic.com Jessica Ziegler

      As the admin to the page you personally will always see the wall as the landing page (which is super fun for testing!), but others will see the app if you select it in your settings..

      On your FB fan page go to edit page>manage permissions>select your app name as the default landing tab.

    • http://Vestorlogic.com Jessica Ziegler

      Submitted on 2011/03/10 at 5:40 pm | In reply to Anonymous.

      As the admin to the page you personally will always see the wall as the landing page (which is super fun for testing!), but others will see the app if you select it in your settings..

      On your FB fan page go to edit page>manage permissions>select your app name as the default landing tab.

      • Ryan

        Actually, only “non fans” see the “default landing page”. Once someone “Likes” your page, they will always land on your wall. Facebook needs to change this.

      • Anonymous

        Thanks Jessica

Follow us on Twitter

Follow @VestorLogic

Like us on Facebook

Get all new posts by email

Want to get every new Vestor Logic post delivered to you? Never miss one again.

Recent Web Design Projects

mtsedge

Web Design Portfolio: Mountain’s Edge

timgower

Web Design Portfolio: Tim Gower

viva

Web Design Portfolio: Viva Sports Promotions

kiskivsb

Web Design Portfolio: Kiski Virtual School for Boys

trailsherpa

Web Design Portfolio: Trail Sherpa Network

Looking for something specific?

Return to top of page

© 2013 Vestor Logic