Question

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:

enter image description here

Ideas?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top