I want to display the facebook recommendations plugin when user is login into facebook. I don't want to show the plugin when user is not logged into facebook because the result looks unpleasing. Is this even possible? How would I implement this to my site?
Thank you in adavance! Maca
facebook social plugin (Recommendations) https://developers.facebook.com/docs/reference/plugins/recommendations/
I already have the Javascript SDK like below implemented in the page. I also have jQuery1.5.2 loaded in the page.
<div id="fb-root"></div> <script>
window.fbAsyncInit = function() {
FB.init({
appId : 'APP ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
channelUrl : 'http://urltomysite.com/channel.html' // custom channel
}); };
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());</script>
Here is the tag for recomendations plugin
<fb:recommendations site="urltomysite.com" width="300" height="300" header="true" font="" border_color=""></fb:recommendations>