Hi everyone
Where can I get hold of some code to "plug" facebook comment box into my page and let people comment directly on my page using their facebook account... i have seen it on loads of sites, but not sure where to start?
cheers
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi everyone
Where can I get hold of some code to "plug" facebook comment box into my page and let people comment directly on my page using their facebook account... i have seen it on loads of sites, but not sure where to start?
cheers
Simplest way is to use the Facebook plugin
https://developers.facebook.com/docs/reference/plugins/comments/
All of the FB social plugins can be found here
https://developers.facebook.com/docs/plugins/
This won't make the comments searchable items in SilverStripe though
cool! so...
<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_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="example.com" data-num-posts="2" data-width="500"></div>
...how would i get the current URL to replace "example.com" from silverstripe within my template .ss file? I am unsure where to look in to SS documentation!
cheers
You need to use {$AbsoluteLink} but that will include the "http://" not sure if that causes a fail or not. Otherwise put "yourdoman.com{$URLSegment}" to include the link to the specific page.
EDIT
here is a link to build in page controls. Useful :)
http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls