Sunday, April 7, 2013

Simplest way to Customize the Facebook Share Button

You all must have used Facebook Share button, either on your Blog or on some other Website, and mostly what it does is share the current URL and the data linked to it. But do you know that you can also customize the Facebook Share button, to make your website's users post and share on Facebook what you want. Here we have the simplest way to do so.
customize facebook share button
Its very easy and simple to do, all you need to do is create an App on Facebook for your website. Visit https://developers.facebook.com/apps , login with your account and click on App button.

Fill in the required information(like sitename, site URL, domain name etc) about your website and save. On creating the App, you will get an App Id, save the App Id because we will be using it to make our custom Share button.
customize facebook share button
Below we have a Share Button for our New Website (http://www.studytonight.com). Use it to know what it does and how you can use it on your website.


I hope you know now, what we mean when we are saying, customizing the Facebook Share Button. Below is the simple code to accomplish this.

http://www.facebook.com/dialog/feed?
  app_id=XXXXXXXXXXXXXXX&
  link=http://developers.facebook.com/docs/reference/dialogs/&
  picture=http://studytonight.com/css/resource/favicon.png&
  name=Want%20to%20Learn%20Programming%20Subjects%20?&
  caption=www.studytonight.com&
  description=Study%20and%20learn%20great%20subjects%20overnight%20with%20the%20help%20of%20most%20to-the-point%20Notes%20and%20great%20concepts.Learn%20Core%20Java,%20C++,%20C,%20DBMS%20etc.&
  message=Studytonight%20is%20Awesome%20and%20Best!&
  redirect_uri=http://www.studytonight.com/


You need to paste you App Id, in the above code, edit the required information as per your website or blog or your application. And use the above code in an anchor tag. Isn't it simple :)

Don not forget it to share with your friends, and do share about our new website Studytonight . For any problem do comment.