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 |
---|---|---|---|---|---|
| int | N/A | The Facebook user ID
( | “he” | “you” |
| bool | | Capitalize the pronoun. | “He” | “You” |
| bool | | Use the objective form (him/her/you/them). | “him” | “you” |
| bool | | Use the possessive form (his/her/your/their). | “his” | “you” |
| bool | | Use the reflexive form (himself/herself/yourself). | “himself” | “yourself” |
| bool | | Use “they” if gender is not specified. | “him” (but if I removed my gender, “they”) | “you” |
| bool | | Use “you” if | “your” | “your” ... |
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.