Really simple FB comments for Silverstripe.
A really simple module for adding Facebook comments to a silverstripe site. There are probably better ones out there, but this is meant to get you up and running in 5 minutes or so.
- Create an app in the fb developers area.
- Either 'composer require markguinn/silverstripe-fb-comments' or download from github into an 'fb-comments' folder in your site root.
- Either install 'tractorcow/silverstripe-opengraph' module (recommended) or add an 'OGApplicationID' method to SiteConfig with your fb application ID. If you do the former, you'll need/want to add $OGNS to your html tag and probably set OpenGraphObjectExtension::$default_image in _config.php.
- Add 'FBCommentsExtension' to BlogEntry or Page (or whichever classes you want comments available). Probably something like:
- Add the following just after the opening body tag IF you're not already including the FB API for something else (like buttons, etc):
<% include OptionalFBAPI %>
- Add the following where you want comments to show up:
<% include FBComments %>
The following configuration options are available on FBComments:
- num_posts - The number of comments to show initially. Default is 3.
- comment_width - The width of the comment area. Default is 600
- color_scheme - See FB documentation for details. Default is light.
- notify - list of email addresses to notify if there's a comment
- notify_from - address from which the notification should come
- notify_subject - subject of the notification email
By default, there is no notification when a new comment is posted, but if you set a list of addresses, the plugin will send an email to those people.
--- name: 'fbcomments' --- BlogEntry: extensions: 0: 'FBComments' FBComments: num_posts: 10 comment_width: 600 color_scheme: light notify: 0: 'firstname.lastname@example.org' notify_from: 'email@example.com' notify_subject: 'New comment on yoursite.com' ---
- Mark Guinn - firstname.lastname@example.org
Copyright (c) 2013 Mark Guinn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.