21287 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 562 Views |
-
facebook plugin with comment ability

30 September 2011 at 4:08am
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
-
Re: facebook plugin with comment ability

30 September 2011 at 4:14am
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
-
Re: facebook plugin with comment ability

30 September 2011 at 4:17am
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
-
Re: facebook plugin with comment ability

30 September 2011 at 4:30am Last edited: 30 September 2011 4:31am
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
| 562 Views | ||
|
Page:
1
|
Go to Top |


