Sébastien Gicquel
Sébastien Gicquel

Reputation: 4386

Is it possible to have only a share button and not a share + like button?

On the « Like Button » developer page, i can only get code for these 4 combinations :

1) like

2) recommend

3) like + share

4) recommend + share

source : https://developers.facebook.com/docs/plugins/like-button

I just want to have a share button. Is it possible ?

I've tried this but it does'nt work of course :

<div class="fb-like" data-layout="button" data-action="share" data-show-faces="false" data-share="false">

I’ve seen in the past that share button was deprecated but it seems that i can still use it :

https://developers.facebook.com/docs/plugins/share-button

But the design of the share button seems to be old and not up to date.

so, we are in 2014 july. Is it possible to have a share button with the same design of the like button ?

I know this type of question have been posted on stackoverflow but facebook API is constantly changing so we need a recent answer.

Upvotes: 0

Views: 2527

Answers (1)

andyrandy
andyrandy

Reputation: 73984

One solution would be to use the Share Dialog of the JavaScript SDK with a custom Share Button: https://developers.facebook.com/docs/sharing/reference/share-dialog

You can use any Button/Image you want for that.

You could also try changing the layout parameter, it looks like the default is "icon". Try with "button" instead.

Edit: I just tried changing the layout parameter, it is definitely the problem. The default is not "button_count" as mentioned in the docs, it is "icon".

Here´s a working example with "button" as layout:

<div class="fb-share-button" data-href="https://xxx" data-type="button"></div>

I´ve filed a bug for this on Facebook.

Upvotes: 3

Related Questions