Fb:name

From Facebook Developer Wiki

Jump to: navigation, search

Description

Renders the name of the user specified, optionally linked to his or her profile.

This also works for Facebook Pages with the ID of the Page passed as the uid parameter.

You can use this tag for both the subject and the object of a sentence describing an action. For example, if a user with the user ID $tagger tags a photo of a user with the user ID $tagee, you could say:

<fb:name uid="$tagger" capitalize="true" /> tagged a photo of <fb:name subjectid="$tagger" uid="$tagee" />

User names and profile links follow standard Facebook privacy rules for other viewing users.

Attributes

RequiredNameTypeDescription
required uid uid The ID of the user or Page whose name you want to show. Alternately, you can use "profileowner" only on a user's profile; you can use "loggedinuser" only on canvas pages.
optional firstnameonly bool Show only the user's first name. (Default value is false.)
linked bool Link to the user's profile. (Default value is true.)
lastnameonly bool Show only the user's last name. (Default value is false.)
possessive bool Make the user's name possessive (e.g. Joe's instead of Joe). (Default value is false.)
reflexive bool Use "yourself" if useyou is true. (Default value is false.)
shownetwork bool Displays the primary network for the uid. (Default value is false.)
useyou bool Use "you" if uid matches the logged in user. (Default value is true.)
ifcantsee string Alternate text to display if the logged in user cannot access the user specified. To specify an empty string instead of the default, use ifcantsee="". (Default value is Facebook User.)
capitalize bool Capitalize the text if useyou==true and loggedinuser==uid. (Default value is false.)
subjectid uid The Facebook ID of the subject of the sentence where this name is the object of the verb of the sentence. Will use the reflexive when appropriate. When subjectid is used, uid is considered to be the object and uid's name is produced.

Examples

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

<fb:name uid="12345" />


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

<fb:name uid="12345"></fb:name>


FBML markup to use when logged in as user 1160:

<fb:name subjectid="219770" uid="219770" /> = himself <fb:name subjectid="219770" uid="1160" /> = you <fb:name subjectid="1160" uid="219770" /> = Josh Gibson <fb:name subjectid="1160" uid="1160" /> = yourself <fb:name uid="profileowner" useyou="true" possessive="true" reflexive="true" /> = your own


<fb:name uid="1160" capitalize="true" /> tagged a photo of <fb:name subjectid="1160" uid="219770" />
reference