agorapulse / grails-facebook-sdk

Facebook SDK Grails Plugin
http://agorapulse.github.com/grails-facebook-sdk/guide
30 stars 13 forks source link

Facebook comment box and like button? #14

Closed confile closed 11 years ago

confile commented 11 years ago

Is it possible to integrate Facebook comment box and like button with your plugin? What is a best practice to combine it?

benorama commented 11 years ago

Hi Michael,

I did not create comment box / like button tags, because they are very easy to integrate with FB Social Plugins and their HTML5 tags.

You just need to set xfbml to true in facebook:initJS tag.

<facebook:initJS
        appId="${facebookContext.app.id}"
        xfbml="${true}" />
...
<div class="fb-like" data-href="http://example.com" data-send="false" data-width="810" data-show-faces="false"></div>
...
<div class="fb-comments" data-href="http://example.com" data-num-posts="5" data-width="810"></div>

I probably should add this example to the documentation?

confile commented 11 years ago

Should I put the facebook:initJS tag in the layout file, because this should be executed only once?

Where do I have to put this tag? In head? In script - environment?

benorama commented 11 years ago

It should be added just after the body tag.

I've updated the doc with a new page: http://benorama.github.com/grails-facebook-sdk/guide/facebookSocialPlugins.html

Thanks for the feedback.

confile commented 11 years ago

Do I have to put some xfbml notation in the head of the page or in the html tag?

benorama commented 11 years ago

I don't think that this is required when you use the HTML5 version of the tags.

benorama commented 11 years ago

It's from the plugin tag lib: http://benorama.github.com/grails-facebook-sdk/ref/tags/initJS.html