Media Headers

Problem

I want to display a bunch of media that all belong to a user, so I’d like some way of showing that.

Solution

Use the fb:mediaheader tag along with its children, fb:header-title and fb:owner-action:

<fb:mediaheader uid="561415460">
    <fb:header-title>Jay's Photos</fb:header-title>
    <fb:owner-action href="http://facebook.com/photos">Facebook</fb:owner-action>
    <fb:owner-action href="http://flickr.com">Flickr</fb:owner-action>
</fb:mediaheader>

which will give you Figure 6-31.

fb:mediaheader as viewed by the owner

Figure 6-31. fb:mediaheader as viewed by the owner

Note that I will see the Facebook and Flickr links in this image (because they’re owner-actions), but other people will see a standard set of links relating to me (Send a Message, Poke, etc.), depending on privacy settings.

Discussion

Unlike tags such as fb:help (in fb:dashboard), the href in the fb:owner-action tag doesn’t have to be a Canvas page URL.

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.