开发者

Use Legacy Facebook "Share" Button Not Facebook "Like"

开发者 https://www.devze.com 2023-03-05 17:45 出处:网络
I want to use \"Share on Facebook\" feature, instead of new \"FB Like\", in my django application. But I can\'t find how I can implement it and set description, title and image to share.

I want to use "Share on Facebook" feature, instead of new "FB Like", in my django application. But I can't find how I can implement it and set description, title and image to share.

Can anyone help me?

UPDATE

I'm doing how DeLonge says. Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 开发者_运维问答xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>Bra</title>
    <link rel="image_src" href="http://site.com/images/logo.jpg" />
    <meta name="description" content="description here">
</head>

<body>
    <a name="fb_share" type="button" share_url="http://www.sharedomain.com/path/" href="http://www.facebook.com/sharer.php?u=http:/www.sharedomain.com/path&amp;src=sp" style="text-decoration: none; ">Share</a><script src="http://static.ak.fbcdn.net/con
nect.php/js/FB.Share" type="text/javascript"></script>
</body>

</html>

But when I click on the button I see this wrong result:

Use Legacy Facebook "Share" Button Not Facebook "Like"

Ideas?


I agree the "share" button is much more useful in certain situations. See code:

<a name="fb_share" type="button_count" share_url="http://www.sharedomain.com/path/" href="http://www.facebook.com/sharer.php?u={INSERT ENCODED share_url HERE}&amp;src=sp" style="text-decoration: none; ">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

Types include: 1) button_count 2) button 3) link.

The title will come from the page itself. However, to add an icon image simply add the following to your HTML <head>:

<link rel="image_src" href="http://www.sharedomain.com/path/thumbnail.jpg" />

I know you are developing in django and I recommend that you hardcode the FB Share button. This is because Facebook is no longer pushing it and most of the APIs are disappearing for it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号