O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting a (Ref) Handle on FBML

Problem

I want to put some FBML into Facebook’s cache so that I can use it in a whole bunch of user Profiles.

Solution

Use the FBML.setRefHandle() method:

$return = $facebook->api_client->fbml_setRefHandle('myHandle','FBML goes here');

Discussion

This will associate the handle you pass as the first parameter with the FBML content that you pass in the second one. You can then pull this content at any time using the fb:ref FBML tag (see FBML Caching for more info).

This can be used only by web-based Facebook apps. Desktop apps are out of luck on this one.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required