Action Links

From Facebook Developer Wiki

Jump to: navigation, search

An action link is a short string of text that accompanies a Feed story and invites the user to take some action related to that story. An action link is a hyperlink to a URL on Facebook or your website or another third-party website.

Placement of the action links depends on the story size and whether or not the story has comments. One line stories render all action links inline, to keep everything as compact as possible.

[edit] Including Action Links in Feed Templates

You need to create a template for each action link, then include these templates within the Feed story template bundles you register. You can frame the action link templates using the same tokens as the one line, short, and full story templates.

You specify action links in a JSON-encoded array of action link templates, like this

array(array('text' => 'Listen to {*song*}', 'href' => 'http://www.fbm.com/{*song-path*}'), array('text' => 'Buy {*album*}', 'href' => 'http://www.fbm.com/{*album-path*}'), array('text' => 'Review', 'href' => 'http://www.fbm.com/reviews/{*album-path*}'))

You include this array in the Feed template console and in the action_links parameter when you call feed.registerTemplateBundle.

[edit] Linking to the Publisher

To directly link to the Publisher, use the fb:publisher-link tag in your template:

array( 'text' => '<fb:publisher-link>Link text</fb:publisher-link>', 'href' => 'http://apps.facebook.com/myapp/', // dummy link )

[edit] Action Link Guidelines

Please read and follow the guidelines and policies for action links.

reference