views:

384

answers:

1

I'm integrating the Facebook Like Button into a site. The likeing functionality is working fine except that you cannot add comments to your like after you've clicked the like button. Several sites including CNN has this working so this should be possible.

The docs mention that you need to use the JavaScript SDK to get commenting to work, which I am doing; however I cannot get commenting to show up.

A fuller-featured Like button is available via the XFBML tag and requires you use the new JavaScript SDK. The XFBML version allows users to add a comment to their like as it is posted back to Facebook.

I cannot find details on which options are available for this more "fully-featured" XFBML like button.

I'm wondering if there is a setting that I need to add, an option that I'm not passing in, or anything that I've overlooked.

I am on a dev server, and I'm linking back to the live site for now. Perhaps the ContactURL and the base URL of the liked page need to be the same in order to get commenting to work?

Here's how I'm embedding the facebook like button:

<!-- facebook -->
<div id="fb-root"></div>
<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({appId: 'XXXXXXXXXXXXXX', status: true, cookie: true, xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>
<!-- facebook -->

...

<fb:like href="example.com" layout="button_count" show_faces="false" width="100" colorscheme="dark"></fb:like>
+1  A: 

You need to make sure that the "connect url" for your appid matches the domain you're putting the like button on. To do this, go to the "Edit Settings" page, and in the "Connect" section of the settings, fill on your "Connect URL".

Facebook's documentation never mentions this.

Mike Sherov
I've been playing around with the Connect URL for several hours. I'm starting to think it might be something to do with the beta site: it's on a subdomain. I've set the Connect URL with and without the beta subdomain with no luck. All "like" links are absolutely linked within the beta site. Unless if I can find something else to try I'm moving on for now and will revisit this once we launch the site.
digitaldreamer
I finally got it working with the comments. You pointed me in setting the the Connect URL, I also set the the Base Domain because we're running off of a subdomain. Also, either the app_id changed or it was set incorrectly so I updated that (it might have changed when we updated the domain?). I also set the application off sandbox mode. I don't know which option eventually did the trick, but thank you very much for pointing me in the right direction.
digitaldreamer