I’m a pretty social girl. Whenever I see something new in social media that I think will have a big impact, I jump on the bandwagon as soon as I can. This past week Facebook released this new “like” button for people to use on their websites. It allows people to like pages that are not part of Facebook, and posts links to the Facebook news feed. Pretty sweet.
I added it to The Pet Wiki as soon as I could. There are two versions – the FBML version and the iframe version. I went with the iframe version because I don’t have the JavaScript SDK running on my site. The iframe version works really well and has all the fuctionality of the FBML version. To add it, include this code in you skin:
<iframe src=”http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($skin->mTitle->getFullURL()); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=dark” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:450px; height:20px”></iframe>
This version does not show the little pictures of people who like the page. If you want it to show the pictures, set show_faces=true. I also modified it to be a lot smaller than the original widget. You can play with the height and width to suit your site. I have like in my header – I stuck it right in the <h1> tag in the skin. I like seeing it at the top. Some people are trying to convince me to put it at the bottom of the page, so that I can include the faces as well. I still have to think about it. What do you think?



The Pet Wiki


















{ 4 comments… read them below or add one }
Hey! Thanks so much for this, Rena. I installed in on my site’s wiki and it is working, for the most part. I’m having a problem on one page so far… that I’ve come across. I wonder if you can help me come up with a solution?
The page I’m having a problem with is:
http://www.hiddeninthesand.com/wiki/index.php?title=Good_%26_Evil
The problem: The “Like” action seems to be acknowledged, but it doesn’t save it. So upon clicking, it says “You like (URL)” and then the iframe refreshes to say “Be the first of your friends to like this!” and it does not show that I already liked it. It also does not show up in my Facebook’s Recent Activity.
I thought this might be due to the fact that there’s an ampersand in the page title (which turns into “%26″). But, I’m not so sure about that because I have ANOTHER page which the title simply is an ampersand (%26) and it works as it should. http://www.hiddeninthesand.com/wiki/index.php?title=%26
Any ideas?
Hi Coz!
Thanks for pointing that out. It is defiantly the ampersand. I am having the same problem with question marks:
http://www.thepetwiki.com/wiki/Can_Cats_%26_Birds_Live_Together%3F
Facebook is really bad about that stuff. I know that when I want to post something to The Pet Wiki’s facebook fan page that has a “?” at the end, I first need to shorten the link with bit.ly so that it won’t drop the last few characters.
I’ll need to look into this some more. When I have an answer, I’ll pet back to you. If you find something before I do, please let me know.
Thanks!
Rena
Ahh, good to know. It’s unfortunate and disappointing, how Facebook claimed to make it so easy to drop these social plugins into our websites, yet leave it up to us to figure out how to properly grab the current page URL, which has proven very difficult to do using some of the software I have on my site.
Yeah. I’m writing to the facebook developers forum about this issue. I hope that they can give us both answers on how to fix it. Wish me luck.