October 2008
Intermediate to advanced
434 pages
12h 7m
English
How do I display content only to a specific user?
Use the fb:if-is-user
tag. The simplest form is:
<fb:if-is-user uid="12345">You're it!</fb:if-is-user>
As with all fb tags that
begin with if, you can use the
fb:else tag inside the fb:if-is-user to provide alternate content
if the user isn’t the droid you’re looking for:
<fb:if-is-user uid="12345">
You're it!
<fb:else>
You aren't it.
</fb:else>
</fb:if-is-user>You might sometimes want to check for a bunch of different users
you want to exclude from seeing some content. The tag supports
comma-separated uids, and you can
use the fb:else tag to actually do
the inverse of the example just shown:
<fb:if-is-user uid="12345,54321,11111,22222">
<!-- No content here -->
<fb:else>
Everyone else sees this bit here.
</fb:else>
</fb:if-is-user>Read now
Unlock full access