Talk:Fb:share-button
From Facebook Developer Wiki
[edit] META tags not currently working
There's an open bug on the fact that this technique isn't working:
http://bugs.developers.facebook.com/show_bug.cgi?id=5291
Actually, I think it is working, but in my original test, the shared URL ended in foo.jpg. I think Facebook decides not to retrieve the META tags because they think the page is just an image. (In my case, it wasn't).
[edit] no href parameter
i cannot get this to work at all. the meta method is broken for me, i'm crying foul. I even pasted the example further down the page and got the 'no href parameter' in my firebug. broken.
- Please file a bug and include the steps necessary to reproduce. Thanks! Pete (563683308 13:55, 22 April 2009 (PDT))
[edit] setting default tab to "Send a Message" rather than "Post to Profile"
On my organization's website, we'd like to use the Share Button functionality (sharer.php) but to have the default tab be "Send a Message" rather than "Post to Profile". Is that possible? From looking at the source of the button Javascript (encodeURIComponent, etc.) I don't see an easy option for it.
146900075 16:05, 16 April 2008 (PDT) Evan Donovan Online Publications Editor, TechMission www.urbanministry.org/user/evandonovan evan@techmission.org
---
I also have the same need (need to set default tab to be "Send a Message" rather than "Post to Profile")... is it possible?
---
It's 8th October 2009. Is there any news on this matter? (sharer.php to open message sending directly?)
[edit] javascript question
Instead of using the <fb:share-button>, I am using the javascript code shown here (as given on the Posted Items application page):
<script>function fbs_click() {
u=location.href;
t=document.title;
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;
}
</script>
The reason I'm using this is because I want to use my own icon for sharing instead of facebook's "Share" button. This works fine, except that I lose the nice popup dialog functionality -- instead it takes the user to a new page to share/post the link. Is it at all possible to get this to work with the contextual dialog popup (or to get the fb:share-button to take some other css style? I tried using my own class definition, but it seems to only take 'url' or 'meta')??
Answer: use CSS to override the look of the .share class
.share {
display:block;
float:left;
width:12px;
height:0px;
padding:12px 0 0 0;
margin:0;
border:none;
background:url(http://www.yoursite.com/images/icon.png);
overflow:hidden;
}
.share:hover {
border:none;
background:url(http://www.yoursite.com/images/icon.png);
}
Change the "12px" to the width/height of your icon.
[edit] how to add html tag to <meta name="description" content='<a href="">test</a>'>
who knows it?
You need to escape the html first
[edit] How to add the image on the 'Share' button
I developed an application. On my profile page, there is a 'Share' button. When I click on it, though, there is no image (on the bottom of the popup, next to the text). How do I add the image here, because I thought that I added the image everywhere where I could find.
-- To add one image, use <link rel="image_src" href="..." /> My question is, how to add more than one image? The share dialog always says, "1 of 1", but I'd like to let the user choose among several.
- Yeah, doesn't seem like there's any way to allow multiple thumbnails short of creating a dummy page with multiple images. Even then, you have to redirect to the facebook share.php and get your page to redirect to an appropriate page once users are sent to the link in the posted item. Arg. - 193700405 08:54, 2 December 2008 (PST)
- here is the bug tracker link if anyone else wants to add their votes: http://bugs.developers.facebook.com/show_bug.cgi?id=2128 - 193700405 09:05, 2 December 2008 (PST)
[edit] ERROR: need to specify one recipient
trying to use the share button but there are several bugs
1) in IE6: cannot enter any recipients in Firefox: can enter recipients but still get a dialog popup box saying "Must specify at least one recipient"
==> ANSWER: This error is caused by having more than one "share" type dialog on a single page. Not sure if there is a work-around.
2) multiple thumbnail images showing up in both IE and Firefox
[edit] Useless Error Message
It seems the <fb:share-button> control has 1 error message:
There was an error trying to share this content. Sorry, the content owner's privacy settings don't allow you to share this content.
==> The actual reason for this error message was that the href of the target_url link was blank. It turns out this can happen if you mistype target_url too. Also for class="url" the href has to be total url, starting with http://
==> In Rails: use _url instead of _path for REST routes, ie. book_url
Source: http://www.c3b.co.uk/2008/02/26/useless-error-message/
[edit] Aligning the Share Button
Is it possible to align the Share button to left, right or center? If so, does anyone have a fix for this?
Yes we can, Use <table> tags. I already implemented in my site. http://kazowie-stage.tomcoh.com/login.php.
just login this site using facebook the u have redirected to your profile page.
Have nice development kannan.
[edit] Problem with IE6 & 7
FBConnect login works fine in both IE6 & 7. but share button, Profile-pic FBML buttons are not showing.
Can any one help me please.
Thanks in Advance, Kannan.
[edit] How to add APP's title and description with share button?
I got the button to work:
<fb:share-button class='url' href='http://apps.facebook.com/myapp/'></fb:share-button>
However, when I use "share" button it opens a dialog with apps.facebook.com as a subject line and my app's link below. I've added <fb:title>My title</fb:title> but it still does not use it. Also, how do I add app description?
Thanks.
[edit] Answer
You need to use the meta class instead of the url class e.g.
<fb:share-button class="meta">
<meta name="medium" content="mult"/>
<meta name="title" content="***ITEM'S TITLE***"/>
<meta name="description" content="***DESCRIPTION OF ITEM THAT IS BEING SHARED***"/>
<link rel="image_src" href="***IMAGE THUMBNAIL URL***" />
<link rel="target_url" href="***LINK URL***"/>
</fb:share-button>
It is not necessary to include an image.
What is meta case for the facebook icon?
[edit] the Meta info should be easier to find
The meta tag links to the share partners page saying that: "See descriptions of the necessary data". But on that page but you have to click on the link "How do I make sure the Share Preview works?" to see the relevant information. I think the meta tags for multimedia should be easier to find. This was quite frustrating since there is really a lack of clear documentation anywhere except here on how to add multimedia to the share-button...
- I appreciate the comment and understand the frustration. I added more navigation to the table here, directing readers to click the link on the other page. I'm reluctant to want to mirror that information on this article, in case it changes (I don't control the content on the share_partners page, and won't know if something changes there). I hope this helps. Pete (563683308 15:28, 3 March 2009 (PST))
[edit] DESCRIPTION!=description
Anyone know why Facebook's share functionality won't see a meta name="DESCRIPTION" but will see meta name="description" ?
Both ways validate with XHTML 1.0 Transitional.
- Looking into this. Thanks. Pete (563683308 15:28, 3 March 2009 (PST))
- This is a known issue. Please use all lowercase letters in all the attributes for this tag. Thanks. Pete (563683308 21:30, 4 March 2009 (PST))
Pete, while I agree that using lower description works, that only impacts sites that someone has control over. will FB address this?
- I filed a report to get this fixed, and that fix should go out today (April 2, 2009). Check it out later tonight or on the 3rd. Thanks for your patience and for reporting this. Pete (563683308 15:44, 2 April 2009 (PDT))
As of 21 June, I can tell you that "Description" doesn't work (not sure if it should). "description" does. Didn't try "DESCRIPTION".
- Hrm, sorry to hear that. I reopened the ticket that was associated with the earlier fix. Thanks for checking in. Pete (563683308 11:11, 22 June 2009 (PDT))
[edit] Cache issues with Share?
How long does FB cache thumbnails and descriptions for a page?
We have a page that was shared before we had all our <link> tags in place and the thumbs that the FB spider found on the page are not related to the content.
Is there a way to flush the cache for our page?
[edit] Multiple thumbnails?
When a user posts a link to a page that does not have an image defined in a <link> tag, the user is given multiple thumbnail options. This seems like a really positive user-interface feature... it gives the user control.
Is it ok to place multiple <image_src> link tags on a page so that the user maintains some control over which thumbnail is used?
- This is being tracked in bug 2128. Vote on it to bring more attention to it. -- Pete (563683308 15:48, 2 April 2009 (PDT))
Is there any way to attach a class or other attribute to certain images to exclude them from the thumbnail option list? I have a page (http://www.culturekiosque.com/nouveau/books/darfur166.html) which uses a number of small graphics for things like "Click to share on facebook", "click to email" etc.. I'd like to prevent those images from appearing in the list of thumbnails, without having to somehow systematically gather all images that are appropriate for including. How do people normally deal with this?
[edit] FB button embedded in a template file
i have put the code in a template file for videos, so every video has the same share button, how do i do for the code to get the url automatically here u=<url>" instead of putting an url there because then all the video pages going to share the same link. If thats even possible?
another question is, i have a FB share button inside of the canvas url in my application, but when i click it to share the content and it gets published, but when i click the link in the post, i get redirected to the url directly in my server, not the canvas url.
[edit] Deep-Linking to a Tab
This issue corresponds to Bug #6967.
Is it possible to have a Share URL go directly to a tab on a page? I've tried this on a few different Share URLs, but they all ignore the attribute that indicates the tab; so I end up back at the Wall page.
Example:
<fb:share-button class="url" href="http://www.facebook.com/pages/MyOrganization/00000000000000001?v=app_0000000000000002" />
The 00000000000002 is necessary to take me to the tab. And copy/pasting the URL into the address bar does bring me directly to the tab. So it's just a matter of persuading the fb:share-button function to respect the attribute.
OR: It's also possible that no attributes are considered, in which case the only way to link directly to a tab is to give it a URL without variable. That is, a URL like:
http://www.facebook.com/pages/MyOrganization/00000000000000001/app/0000000000000002
Any thoughts?
