O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

He Said, She Said: Dealing with Pronouns

Problem

Gender issues are complicated. I could just use the third-person pronouns (“they” and “their”) for everything, but that’s really not grammatically correct. How do I figure out whether to use “he” or “she”? And what about people who didn’t specify a gender on their Profiles?

Solution

The fb:pronoun tag will output the correct pronoun for the user specified by the uid parameter. The simplest form is:

<fb:pronoun uid="12345" />

Discussion

Just like the fb:name tag, the fb:pronoun tag gets itself into all kinds of trouble with possessives and reflexives and lots of other grammar ghouls that you don’t want to have to deal with. Luckily, FBML will deal with them for you! See Table 6-2 for a list of the tag’s parameters.

Table 6-2. Parameters for fb:pronoun

Name

Type

Default value

Description

They see

I see

uid

int

N/A

The Facebook user ID (uid) of the user or Page whose pronoun you want to show. You can also use loggedinuser or profileowner. This is the only required field.

“he”

“you”

capitalize

bool

false

Capitalize the pronoun.

“He”

“You”

objective

bool

false

Use the objective form (him/her/you/them).

“him”

“you”

possessive

bool

false

Use the possessive form (his/her/your/their).

“his”

“you”

reflexive

bool

false

Use the reflexive form (himself/herself/yourself).

“himself”

“yourself”

usethey

bool

true

Use “they” if gender is not specified.

“him” (but if I removed my gender, “they”)

“you”

useyou

bool

true

Use “you” if uid matches the logged-in user.

“your”

“your” ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required