Fb:photo

From Facebook Developer Wiki

Jump to: navigation, search

Contents

Description

Renders a Facebook photo.

Attributes

RequiredNameTypeDescription
required pid string An API-supplied pid of the photo. The pid cannot be longer than 50 characters. (The use of a pid found in the query string of a photo URL on Facebook is deprecated.)
optional uid int (Deprecated) If the pid is not an API-supplied pid, this should be the ID parameter in the query string used to find the pid. This property is not supported in the XFBML variant of this tag and is deprecated for the FBML variant.
size string The size of the photo to display. (Default value is normal.). Other valid values are thumb (t) (75px width), small (s) (max of 130px width or height), and normal (n) (max of 604px width or height).
align string The image's alignment. (Default value is left.) and the only other valid value is right.

Examples

If you're formatting the tag as FBML, you don't need to use a closing tag.

<fb:photo pid="12345" />


If you're formatting the tag as XFBML for Facebook Connect, you must use a closing tag.

<fb:photo pid="12345"></fb:photo>

Notes

  • The pid returned after making an FQL call is not the same pid found in the string of a photo URL. Please only use the pid found via the API.
  • If the user is not able to see the photo, then the photo will not be rendered. To provide an alternate user interface for those users, you can use the fb:if-can-see-photo tag.
  • There are 2 undocumented parameters width and height. By setting these you can scale an image to the preferred size. Keep in mind that this will use in-browser scaling and results may vary depending on the browser
reference