Fb:share-button

From Facebook Developer Wiki

Jump to: navigation, search

Description

Renders a standard Share button in a profile for the specified URL or content.

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


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 (click the link How do I make sure the Share Preview works?). The meta class may contain this attribute. (This attribute is not supported in XFBML.)
link string The content (such as image thumbnails) for the shared item. See descriptions of the necessary data (click the link How do I make sure the Share Preview works?). The meta class may contain this attribute. (This attribute is not supported in XFBML.)


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


If you're formatting the tag as XFBML for Facebook Connect, you must use a closing tag.

<fb:share-button href="http://apps.facebook.com/example"></fb:share-button>
reference