Search code examples
javascriptfacebooksdkxfbml

Is there a max no. of XFBML Tags (fb:profile-pic...)


I recently seem to have reached a limit regarding the no. of XFBML-tags which are allowed per document/page. In particular, I had a page with 100+ fb:profile-pic elements:

<fb:profile-pic uid="..."/>
<fb:profile-pic uid="..."/>
...

When rendered & parsed, all fb-profile-pic's remain empty, no javascript errors whatsoever etc. If I reduce the XFBML elements to 66, everything works fine and the profile-images are rendered. On more XFBML-tag (67), and everything is gone. It's also not about the particular User-IDs (I've tried a different set, same result).

I'm using the latest JS SDK (http://connect.facebook.net/de_DE/all.js), obviously with xfbml:true on fbAsyncInit.

Do you have experienced similar limits, and is there a way around this?


Solution

  • Why not render img tags directly? I have a wonderful little php-helper for the profile-pic url:

      public function profileImage($fbUid = 1, $type = "square") {
        if (!in_array($type, array("square", "small", "normal", "large"))) {
          $type = "square";
        }
        return "https://graph.facebook.com/$fbUid/picture?type=$type";
      }
    

    Call it directly with

    <img src="<?=profileImage("100002012872577")?>" ...>