Ask Your Question
1

Twitter and Facebook integration

asked 2012-06-12 21:00:35 -0600

kintali gravatar image

Every askbot question has twitter and facebook buttons on the left side. When I click on the twitter button only the title of the answer is added into the twitter message box. When I click on the facebook nothing is added into the facebook message box.

  • Is somebody working on fixing these issues ? Can somebody please tell me how to add both the title and url of the question into these message boxes ?
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-06-21 17:30:43 -0600

alexandros.z gravatar image

updated 2012-06-21 17:35:14 -0600

Hello.

I think that the problem appears because the url that is constructed is broken. This is the one created ("undefined" it is an indication that something is broken):

http://www.facebook.com/sharer/sharer.php?u=undefined&ref=fbshare&t=Twitter+and+Facebook+integration

This should be the right one (instead of "undefined" the real url of your question):

http://www.facebook.com/sharer/sharer.php?u=http://askbot.org/en/question/7848/twitter-and-facebook-integration/&ref=fbshare&t=Twitter+and+Facebook+integration

And this is the result:

image description

Hope it helps!

edit flag offensive delete link more

Comments

Where is this code in askbot ? How do I get the current url ?

kintali gravatar imagekintali ( 2012-06-22 11:16:27 -0600 )edit

I dont have the latest sources, so I am not sure about the exact lines of the source code. But you can find it in post.js. There is a function called socialSharing where defines about facebook sharing facebook: {url: "http://www.facebook.com/sharer.php?u={URL}&ref=fbshare&t={TEXT}",},

alexandros.z gravatar imagealexandros.z ( 2012-06-22 16:50:19 -0600 )edit

Thanks alexandros.

kintali gravatar imagekintali ( 2012-06-22 23:41:28 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-06-12 21:00:35 -0600

Seen: 1,053 times

Last updated: Jun 21 '12