Worth a Thousand Words: Profile Pictures
Problem
Profile pictures are awesome because they’re so easy to recognize and they really draw people in! How can I display someone’s pic?
Solution
The fb:profile-pic
tag will display the Profile picture for the user specified
by the uid
parameter. The simplest
form is:
<fb:profile-pic uid="12345"/>
Discussion
In addition to the uid
, there
are two optional parameters, listed in Table 6-3.
Table 6-3. Parameters for fb:profile-pic
Name | Type | Default value | Description |
---|---|---|---|
| int | N/A | The Facebook user ID
( |
| bool | | Link to the user’s Profile. |
| string | | Size of image to display (see the upcoming list). |
Differently sized pics can be hugely useful in different scenarios. Using my current Profile picture (taken by my good friend Will Pate), the following list shows a breakdown of the options (note that you can use the short form listed in parentheses):
- thumb (t): 50 pixels wide
- small (s): 100 pixels wide
- normal (n): 200 pixels wide
- square (q): 50×50 pixels
Get Facebook Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.