Fb:profile-pic
From Facebook Developer Wiki
Contents |
Description
Turns into an img tag for the specified user's or Facebook Page's profile picture.
The tag itself is treated like a standard img tag, so attributes valid for img are valid with fb:profile-pic as well. So you could specify width and height settings instead of using the size attribute, for example.
Attributes
| Required | Name | Type | Description | |
| required | uid | int | The user ID of the profile or Facebook Page for the picture you want to display. On a canvas page, you can also use "loggedinuser". | |
|---|---|---|---|---|
| optional | size | string | The size of the image to display. (Default value is thumb.). Other valid values are thumb (t) (50px wide), small (s) (100px wide), normal (n) (200px wide), and square (q) (50px by 50px). Or, you can specify width and height settings instead, just like an img tag. | |
| linked | bool | Make the image a link to the user's profile. (Default value is true.) | ||
| facebook-logo | bool | (For use with Facebook Connect only.) When set to true, it returns the Facebook favicon image, which gets overlaid on top of the user's profile picture on a site. |
Examples
If you're formatting the tag as FBML, you don't need to use a closing tag.
If you're formatting the tag as XFBML for Facebook Connect or an iframe application, you must use a closing tag.
Note: If you're specifying a custom image size (using the height and width attributes), you no longer need to include px for each dimension.
Another FBML example.
It seems that a size of "normal" currently provides the best quality available through this tag. If you need an image larger than 200px wide and need this done within FBML, you can use size "normal" in combination with width. This example creates an image twice the width of size "normal" in the best quality possible with this tag.
Notes
If you need a larger version of the photo, don't want to stretch out the 200px wide photo, and can deal with having to use an API call rather than being able to use an FBML tag, the URL for the gallery-view image (up to 604px in width or height) can be obtained using FQL via the src_big column of the photo table (example included).
See Also
You can see a real world example of this tag in all three demo applications (Footprints, Restaurants and Who's Showing Up). Go to Demos for more details and to download and install the demo apps.
