Fb:name

From Facebook Developers Wiki

Jump to: navigation, search

Contents

[edit] 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" />


[edit] Attributes

RequiredNameTypeDescription
required uid uid The ID of the user or Page whose name you want to show. You can also use "profileowner" on a user's profile or an application canvas page; 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. (default value is [empty string])
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.


[edit] Examples

<fb:name uid="12345" />


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" />


[edit] 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.