Talk:XFBML

From Facebook Developer Wiki

Jump to: navigation, search

Not all fbml tags can successfully render in iframe applications, for example fb:tabs, does somebody know which others?

Have you tried this method? Using_HTML_to_Imitate_XFBML? Pete (563683308 15:17, 24 August 2009 (PDT))


The site static.ak.connect.facebook.com seems to have stopped working today, but fortunately removing the 'connect' part of the URL seems to fix the problem. Therefore, I updated the docs. --1006207 02:27, 29 October 2008 (PDT)

Contents

[edit] Outdated List?

The list of tags was posted over 2 months ago, is it currently out of date? I was trying to figure out which tags were currently valid by going through some JavaScript source files (btw: if you know where the browser pulls these tags in from, could you help me out in this thread? http://forum.developers.facebook.com/viewtopic.php?id=25568 thx). I found this in the last two lines:

FBIntern.DataHelper.createClass(...  ...); var list = [
  FB.XFBML.$create_ElementsRegistration('fb','login-button',FB.XFBML.LoginButton),
  FB.XFBML.$create_ElementsRegistration('fb','name',FB.XFBML.Name),
  FB.XFBML.$create_ElementsRegistration('fb','pronoun',FB.XFBML.Pronoun),
  FB.XFBML.$create_ElementsRegistration('fb','serverFbml',FB.XFBML.ServerFbml),
  FB.XFBML.$create_ElementsRegistration('fb','eventLink',FB.XFBML.EventLink),
  FB.XFBML.$create_ElementsRegistration('fb','groupLink',FB.XFBML.GroupLink),
  FB.XFBML.$create_ElementsRegistration('fb','photo',FB.XFBML.Photo),
  FB.XFBML.$create_ElementsRegistration('fb','video',FB.XFBML.Video),
  FB.XFBML.$create_ElementsRegistration('fb','userLink',FB.XFBML.UserLink),
  FB.XFBML.$create_ElementsRegistration('fb','unconnected-friends-count',FB.XFBML.UnconnectedFriendsCount),
  FB.XFBML.$create_ElementsRegistration('fb','container',FB.XFBML.ContainerElement),
  FB.XFBML.$create_ElementsRegistration('fb','user-status',FB.XFBML.UserStatus),
  FB.XFBML.$create_ElementsRegistration('fb','profile-pic',FB.XFBML.ProfilePic),
  FB.XFBML.$create_ElementsRegistration('fb','prompt-permission',FB.XFBML.PromptPermission),
  FB.XFBML.$create_ElementsRegistration('fb','share-button',FB.XFBML.ShareButton),
  FB.XFBML.$create_ElementsRegistration('fb','add-section-button',FB.XFBML.AddSectionButton)];
  FB.XFBML.Host._registeredElements=(list);
  FB.FeatureLoader.singleton.onScriptLoaded(['XFBML']);

The tags that it looks like it declares here differ from those in the article text. Whats going on? --Garrett 21:54, 17 December 2008 (PST)

[edit] Problems rendering fb:prompt-permission

I cannot get it to render on my website; I can however get a few other tags to render (login-button, profile-pic, etc). I have also tried in the demo console

 *http://www.somethingtoputhere.com/demo/xfbml_console/index.html

with same dissapointing results. Am I missing something? Thanks in advance...--890240009 09:53, 18 March 2009 (PDT)

Can you paste the code from the file here for us to look at and investigate? Thanks, Pete (563683308 12:15, 18 March 2009 (PDT))

Actually I solved the problem; The fb:prompt-permission tag does not render unless you have a valid session. And because I was using the java wrapper to connect to fb, the browser had no idea about the the session from the backend. I unsucessfully tried to construct a session in the browser based on the session key from the backend, but I gave up and used the fb:login-button on my login page (I had a link pointing to http://www.facebook.com/login.php before). It now works like a charm:)

[edit] Improved "Rendering xFBML" paragraph

At least, I hope. :)--565413697 03:25, 10 August 2009 (PDT)

If what is there is an improvement, I think it needs more improvement in telling the user what and how to do it. Or else, someone didn't accept the proposed improvements. This section currently says:

 Rendering XFBML
 The following steps are needed if you want set up a Connect application or even if you want just render XFBML tag
 in your IFrame applications.
    1. Go to the Developer application and specify a Connect URL. This is the URL on your site where your Facebook
    Connect code lives (and where your XFBML gets rendered). A typical URL can be something like:
    http://mywebsite.com/php/myapp. 

Question: Where on the page at http://www.facebook.com/developers/ does one specify a Connect URL? How does one specify a Connect URL? There are no clues on that page.

[edit] XHTML

"For the user's browser to correctly recognize XFBML tags, you need to specify that the page is in XHTML."

The way to specify that a page is in XHTML is to send the content-type as "application/xhtml+xml" in the http headers and begin the page with "<?xml version=...". However, doing this will break Facebook Connect as its javascript uses document.write which doesn't work with real XHTML.

Either XFBML isn't a subset of XML, or facebook's javascript is broken - does anyone know which? 61014671 17:33, 29 September 2009 (PDT)

reference