FaceBook Like Extension for BlogeEngine.net

FaceBook Like Extension for BlogeEngine.net

by MGD King March 29, 2011

The other day I was looking around the new BlogEngine.net Gallery and stumbled across a nifty little extension that adds a FaceBook “Like” button to all posts and posts’ pages. This type of extension has been a much sought after request in the BE community for a while so I had to take a look and see how it works.

Wow! I was totally impressed because this little extension does exactly what I wanted it to do, plus it has the added feature of adding a Tweet button as well!!! Easy to implement and works like a champ!

Being that the code is open source and the author said that “any changes accepted” I wanted to make some layout changes to the extension because I wasn’t happy with having to modify the CSS file(s) of BE. Yes, I could have just added the author’s code to the Global.css file as he suggests for installation but that would mean that every time I updated BE I would have to manually update that CSS file. Or I could have just added it to my theme’s CSS file, but not only would I have the same problem, but I have multiple themes and I didn’t want to update them all. Plus, I think my modifications make installation easier by just dropping the extension into the extensions folder.

The extension has three options for displaying your Like Button but because the author’s code was limiting what was being viewed I added an option to adjust the height of the extension. I also changed the alignment of the Tweet and Facebook buttons (they’re side-by-side) because they weren’t aligning properly for me (the Tweet button was lower than the Facebook button). I also left the author's credits intact in the extension because he did all of the hard work and he deserves the credit! Great job Gayan!

To install the extension place it in your App_Code\Extensions folder.

FacebookLike.zip (2.01 kb)

****UPDATE**** There's an issue that you should be aware of with how FaceBook parses information from posts. Read here for more details.

 

Comments (10) -

gayan
gayan
4/7/2011 8:35:46 AM #

hey i really glad that you have improved the extension it's totally OK with me i have upgrade the extension for twiiter support. this extend also great i enjoyed the post and i got the your response sorry for the delay to response you

Reply

MGD King
MGD King
4/7/2011 9:14:09 AM #

Thanks for replying! I was beginning to wonder if you were having issues with your blog. LOL

Reply

Jackson
Jackson
9/15/2011 8:05:12 PM #

Using your theme and love it.  Also uploaded facebooklike.cs file to the server, but I am a little unclear on how to enter twitter info to activate the twitter button function.
Any help appreciated.
Thanks,
Jackson

Reply

MGD King
MGD King
9/20/2011 1:52:53 PM #

Jackson,

There isn't any twitter info to add to the functionality of the Tweet button. All it does is links your article to twitter so the user can post it so all you have to do is enable it in the extensions menu.

Thanks for using my theme! I'm happy that others find it useful!

Reply

mark
mark
10/12/2011 2:53:33 PM #

This and many other facebook sharing/liking extensions havent worked for me, keep getting country [not specified] in the section where it should have the blog post text for some reason.. tried everything and cant figure it out:

http://blogengine.codeplex.com/discussions/275364

Reply

MGD King
MGD King
10/13/2011 10:13:45 AM #

It's working fine here, and I haven't heard anyone else having this issue that's tried the extension.

Reply

mark
mark
10/13/2011 10:28:48 AM #

The problem i have found is with the dynamically generated code.. if you do the share by post.aspx?POSTID here from the xml file it works fine, but if you use the dynamically generated post it fails..

IE:
http://www.facebook.com/sharer/sharer.php?u=http://www.bloggersonline.com/.../test-test.aspx  gives you the nasty country not specified message in the body section.

if you fill in excerpt, it will show up correctly, but thats not ideal.. it should be able to pull the data from the body without issue.

if you goto the root of this site, to share, its fine too http://www.facebook.com/sharer/sharer.php?u=http://www.bloggersonline.com

So i've concluded its something about how the aspx autogenerated pages are being "reconstructed", where the end result is "missing" something that is needed for it to successfully pull the body section.



Reply

MGD King
MGD King
10/13/2011 4:44:40 PM #

Mark, please take a look here www.mgdking.com/.../...k-Like-Extension-Issue.aspx. Thanks for the troubleshooting help today and for bringing this issue to light. I can't believe I haven't heard about it sooner.

Reply

Jas
Jas
1/8/2013 8:48:23 AM #

Hello MGD,

Thanks for the extension

Quick suggestions for improvement

1) Mark it to fetch image for twitter + facebook locally from pics folder rather than internet

2) When somebody clicks on Like button , it should open up small window where user can type comment and then Post it , rather than simply Like count increment.
For example  have look at Facbook Like button following site
timesofindia.indiatimes.com/.../17941745.cms

Reply

MGD King
MGD King
1/11/2013 2:04:02 PM #

I didn't create the extension, I just changed the layout of it. The backend stuff was written by the author Gyan.

Reply

Pingbacks and trackbacks (2)+

Add comment


  • Comment
  • Preview
Loading

Who Is MGD King?

MGD KingA lot of people ask me what does MGD King mean? Well, it was a nickname given to me because I used to drink large quantities of Miller Genuine Draft. Someone mentioned to me that I was the King of MGD, and so it stuck.

I'm On Twitter!

Note: For Customization and Configuration, CheckOut Recent Tweets Documentation
 
 

Latest Comments

Comment RSS