Reputation: 12549
I'm having trouble with understanding the basics of the Facepile plug-in for Facebook developers. I've successfully got Facepile up and running and displaying a picture of someone who 'likes' the page, as long as they're a friend.
That's all good. But there's another feature of Facepile that I just can't get working. And that's to simply display how many people have liked the page. On the Facepile developers page it says:
If some users have liked your page, but none of the viewing users friends have liked it, the plugin will display the total number of users who have liked your page.
However, this simply just doesn't show up for me. Is there something I might be missing? Here's my code as it appears:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=00000000";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script src="http://connect.facebook.net/en_US/all.js
#appId=0000000000000&xfbml=1"></script>
<div class="fb-like" data-href="http://myurl" data-send="false" data-width="450" data-show-faces="true"></div>
<div class="fb-facepile" data-href="http://myurl" data-action="watch" data-max-rows="1" data-width="300"></div>
Bare in mind that I replaced the App ID and URL with dummies. An insights you might have will be hugely appreciated!
Upvotes: 1
Views: 3052
Reputation: 2672
Update: After reading your question carefully, I'd recommend you to try the IFRAME version once to see if that works for you.
<iframe src="http://www.facebook.com/plugins/facepile.php?href={SITE_URL}&size=small&width=292&max_rows=1" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px;"></iframe>
Old Answer:
You don't need facepile, assuming "like count" is the only thing you need. Simply use Open Graph for it.
Open Graph:
https://graph.facebook.com/{PAGE_ID}
eg. https://graph.facebook.com/314467614927
Returns:
{
"id": "314467614927",
"name": "Angry Birds",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/276791_314467614927_795266395_s.jpg",
"link": "http://www.facebook.com/angrybirds",
"likes": 20292918,
...
}
Now retrieve the like count from the JSON, and populate it wherever you wish to display it using JS.
Upvotes: 1