Nov 16, 2015 at 11:31 am
Developers My Apps Products Docs Tools & Support News Product Docs App Ads Analytics for Apps App Events App Invites App Links Atlas API Audience Net
Update posted by Muhammad Faraz Ul HaqProduct Docs
APIs and SDKs
Like Button for the Web
The Like button is the quickest way for people to share content with their friends.
A single click on the Like button will 'like' pieces of content on the web and share them on Facebook. You can also display a Share button next to the Like button to let people add a personal message and customize who they share with.
Like Button ConfiguratorCode ExampleSettingsAdjust LanguageFAQsStep-by-Step
1. Choose URL or Page
Pick the URL of a website or Facebook Page you want to use with the like button.
2. Code Configurator
Paste the URL to the Code Configurator and adjust settings like the of your like button. Click the button to generate your like button code.
3. Copy & Paste HTML snippet
Copy and past the snippet into the HTML of the destination website.
Like Button Configurator
URL to LikeWidth
Layout
Action Type
Full Code Example
Copy & paste the code example to your website. Adjust the value to your website URL. Next use the meta tags to adjust your link preview. and should use the same URL.
Settings
In addition to the settings above, you can also change the following:
Setting | HTML5 Attribute | Description | Default |
---|---|---|---|
The verb to display on the button. Can be either or | |||
The color scheme used by the plugin for any text outside of the button itself. Can be or . | |||
The absolute URL of the page that will be liked. | Current URL. | ||
If your web site or online service, or a portion of your service, is directed to children under 13 you must enable this | |||
Selects one of the different layouts that are available for the plugin. Can be one of , , or . See the FAQ for more details. | |||
A label for tracking referrals which must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). See the FAQ for more details. | None | ||
Specifies whether to include a share button beside the Like button. This only works with the XFBML version. | |||
Specifies whether to display profile photos below the button (standard layout only). You must not enable this on child-directed sites. | |||
The width of the plugin (standard layout only), which is subject to the minimum and default width. Please see Layout Settings below for more details. | See in Layout Settings |
Layout Settings
There are the following options:
Layout | Default Sizes |
---|---|
Minimum width: 225 pixels. | |
Minimum width: 55 pixels. | |
Minimum width: 90 pixels. | |
Minimum width: 47 pixels. |
Adjust Language
You can adjust the language of the Like Button by loading a localized version of the Facebook JavaScript SDK. When you load the SDK adjust the value to use your locale: Just replaced by your locale, e.g. for French (France):
Supported locales are referenced in the Facebook Locales XML file. You may need to adjust the width of a Social Plugin to accommodate different languages. You may find more information on our Localization & Translation page.