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

Page and Box Titles

Problem

Page titles are a really important element of Search Engine Optimization, and they also provide users with better bookmarks and history list entries. How can I set titles for the different pages in my app?

Solution

Use the fb:title tag to set the title of your page. When used on a Canvas page, this will append the included text to the title of the window. The simplest form is:

<fb:title>Title Here</fb:title>

If your app is called “Super Disco Napping,” and you set the fb:title to “Invite Friends to Nap,” and you’re running Firefox 3 on Mac OS X (which you should be!), the window title bar will look something like Figure 6-12.

Window title

Figure 6-12. Window title

You can also use the fb:title tag to set the title of the various boxes you can place the tag in, including Profile Boxes and the like. When used inside of a wide Profile Box, you’ll get something like Figure 6-13.

Profile Box text

Figure 6-13. Profile Box text

Discussion

The fb:title tag is often used with the fb:subtitle tag to create a header like the one you’ll see in Profile Boxes on users’ Profiles. For example, the following:

<fb:title>Super Disco Naps</fb:title> <fb:subtitle seeallurl="http://apps.facebook.com/superdisconaps/all"> Displaying 10 of 2587 naps <fb:action href="http://apps.facebook.com/superdisconaps/nap.php"> Take ...

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