Fb:share-button

From Facebook Developer Wiki

Jump to: navigation, search

Description

Renders a standard Share button in a canvas page for the specified URL or content. You can also use this tag to put a Share button on a Static FBML tab on a Facebook Page.

Important: All attributes in the table below must be written in all lowercase letters.

Note: If you're implementing a Facebook Share button on a Facebook Connect site, you need to use the XFBML version of the tag.

Attributes

RequiredNameTypeDescription
required class string The type of share button. When used as an FBML tag, valid values are url, to render a share of the URL specified with the href attribute, and meta, to render a share with the given data. When used as an XFBML tag, the value must be url.
href string The reference URL to share. This attribute is required for the url class only.
optional meta string The metadata about the shared item. See descriptions of the necessary data. The meta class may contain this attribute.
link string The content (such as image thumbnails) for the shared item. See descriptions of the necessary data. The meta class may contain this attribute.

Examples

<fb:share-button class="url" href="http://apps.facebook.com/example" />
sharebtnrj2.png


<fb:share-button class="meta"> <meta name="medium" content="blog"/> <meta name="title" content="Leonidas in All of Us"/> <meta name="video_type" content="application/x-shockwave-flash"/> <meta name="video_height" content="345"/> <meta name="video_width" content="473"/> <meta name="description" content="That's the lesson 300 teaches us."/> <link rel="image_src" href="http://9.content.collegehumor.com/d1/ch6/f/6/collegehumor.b38e345f621621dfa9de5456094735a0.jpg"/> <link rel="video_src" href="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1757757&autoplay=true"/> <link rel="target_url" href="http://www.collegehumor.com/video:1757757"/> </fb:share-button>
sharebtnrj2.png