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

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.

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.

Related

Facebook Like popup disappears almost immediately

I'm creating a blog on Blogger and I would like to include a Facebook Like button in the right column (width:280px). I'm using Blogger's HTML/JavaScript gadget. I got the HTML5 code which displays the button properly.
<div class="fb-like" data-href="http://myblogaddress.blogspot.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="true"></div>
When I click on it a popup shows up with option to add a comment but it disappears almost immediately. I figured out that this behavior is caused by overlapping with the < div > edge. I have tried to set various parameters which I thought might resolve the issue but it didn't work.
<div style="position:relative;overflow:auto;z-index:1;" class="fb-like" data-href="http://myblogaddress.blogspot.com" data-send="false" data-layout="box_count" data-width="60" data-show-faces="true"></div>
When I was searching for a solution I came across this blog which also has the Facebook Like button in the right pane and it works like a charm, the popup window overlaps the edge and displays on top of everything else. Do you know how to achieve this behavior?
I had the same issue but I realized it was a Chrome issue. IE and Firefox was working fine. Maybe check your Settings -> Advanced Settings > Privacy -> Content Settings -> Popups to ensure that Chrome doesn't prohibit the popup.
I know it is an old post but I'll just leave an answer anyway :) I had the same issue and when trying to open the link in IE I get this error: "href+is+not+properly+formatted#" so I fixed my Url and now it works.
I was having the same problem.
Turns out facebook closes the popup when there are mistakes in your opengraph declarations on the shared URL
in my case,
og:image lacked the domainname
cheers!

Add Tumblr Like Button to non-Tumblr Page?

Is it possible to add a button like the nice one done by ThinkingStiff in the example here ?
That one is designed to be used on Tumblr pages. I'd like to get the same functionality on a page that is outside of Tumblr.
Yes, I already have a method to get the {ReblogURL} and the {PostID} values it needs.
Thanks for your help!
Ah, solved myself. Just replace {ReblogURL} and {PostID} in original code:
<div class="my-like" data-reblog="{ReblogURL}" data-id="{PostID}" title="Like"></div>
with the new vars (from whichever method you use to get them) and replace that div.
Example:
<div class="my-like" data-reblog="3Pbn6aNA" data-id="12345678901" title="Like"></div>
Note: Those vars are not a live Tumblr post.

facebook button showing only once when outputting it via while loop

I'm using Gallerific with history plugin. In the while loop where I print all the images I want to add a facebook share button for each image using the specific image-url given by the history-plugin.
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"></script>
$images=mysql_query("SELECT filename FROM images etc.");
while ($row = mysql_fetch_array($images)) {
<li><a class='thumb' name='imagename' href='url-to-image' title='description' onclick='clickedThumbnail()'><img src='url-to-thumb' alt='".$row['comment']."'/></a>
<div class='caption'>
<a name=\"fb_share\" type=\"button_count\" share_url=\"http://url-to-image-made-by-the-history-plugin\">Share</a>
</div>
}
My problem is that it is only printing the facebook share button once. In the first while-loop. On the rest of the images it is printing the content of the <a>-tag ('Share') with the right attributes, but it is not clickable. I've tried without 'share' in the <a>-element but then I get nothing on the other images. But I always get the correct FB-button on the first image.
According to developers.facebook.com I only have to include the javascript once even though I'm using several Facebook buttons on one page.
I have also tried to put several facebook-buttons outside the while-loop and it works fine.
Also, when I type the direct url to the images given by the history plugin it works fine. So my conclusion is that is has to do with printing the facebook-buttons from a while-loop..?
I used this approach instead http://developers.facebook.com/docs/reference/javascript/FB.ui/
by changing some variables dynamically for each image. Works like a charm!
Thanks for the comments.
That plugin is deprecated. See: http://developers.facebook.com/docs/share/
You will want to use the share functionality that is part of the like button. See: http://developers.facebook.com/docs/reference/plugins/like/

Clean AddThis / Facebook Like / Recommend Button without Social Text?

I've been desperately seeking a way to disable the facebook social text right next to the "Recommend" button. Is it possible, to simply render a "Recommend" button, without anything else (no counter, no text, JUST the button)?
The problem is, CSS wont be applied since all the elements are inside the iframe, so I cant just hide the element itself using CSS (which in this case would be a td).
Also, I cant just put everything in a div and give it overflow:hidden and a fix width, since the pop up which appears when actually clicking the "Recommend" Button would then not be fully visible.
My current implementation comes via AddThis:
<a class="addthis_button_facebook_like" fb:like:size="small" fb:like:layout="none" fb:like:action="recommend" fb:like:width="10"></a>
Any ideas?
Thanks
Alex
Facebook polcy IV 4 d:
You must not obscure or cover elements of our social plugins, such as the Like button or Like box plugin.
So if you can't do it by using their like button creation tool you shouldn't do it.
Using the Add This Facebook Like button you can avoid the count using this attribute
fb:like:layout="button"
So in your case you would have
<a class="addthis_button_facebook_like" fb:like:size="small" fb:like:layout="button" fb:like:action="recommend" ></a>
"Recommend" with a counter comes closest to your request. I too don't like the social text (e.g. "57 people like this. Be the first of your friends"), yet I do like the naked counter. The code that I use is:
<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:action="recommend" fb:like:width="135"></a>
See AddThis own documentation here.

facebook comment plugin: remove like button

The FB: comment plugin comes with both a like button and comment box. Does anyone out there know how to remove the like button from the facebook comment plugin?
I got it working:
To remove (hide) the like-button that
comes above the comments-box To hide
the Like botton, you will need to add
2 attributes and create a CSS file.
1. simple="1"
2. css="http://yoursitedomainname.com/fb_comments.css"
<fb:comments expr:title='data:post.title'
expr:url='data:post.url'
expr:xid='data:post.id' simple='1'
css='http://yoursitedomainname.com/fb_comments.css'/>
in the css file add this style code:
div.like, div.like div {display:none;}
If you want you can just link to my
hide CSS file:
http://www.fileden.com/files/2006/10/3/258652/hidelike.css
Thanks to Gil Goldshlager, original post # forum.developers.facebook.net/viewtopic.php?id=58903
I've also searched for this answer but found nothing. I guess it's not possible for the moment. But if someone knows anything about this, I would also like to hear about it!
The answer from mctaco/Gil Goldshlager did not work for me. i assume, they only work with the old comments plugin. But i tried around with the tags and this one was working for me, to remove the like button:
<div class="fb-comments" data-href="{{ request.build_absolute_uri }}"></div>
This code comes from django. if you are using another server side language, then you have to replace {{ request.build_absolute_uri }} with the absolute uri from the page, where you want to have the comments plugin installed.
If you omit the data-href attribute, the like button is displayed.