Sourcefabric Manuals

 English |  Español |  Français |  Italiano |  Português |  Русский |  Shqip

Newscoop 4.2 Cookbook

Disqus and Facebook comment systems

You can use the commenting systems of Disqus and Facebook within your Newscoop site. Depending on your strategy regarding social media and user comments, these external system might be a better option than Newscoop's own commenting system. Facebook-driven comments appear on the profile page of the commenter thus driving new cirle of visitors to your site. The slick Disqus appearance might als be an argument to go with this third party service. Another advantage could be that this would allow to moderate comments without having to have access to the Newscoop backend.

One little warning from our side: comments are content. And the content you and your community generate on your site, should be on your site. If you rely on third party tools for comments, think about what would happen if these services either go out of business or change their licensing model or API. If this would happen, you would lose all your comments. This is the downside of third party services.

Facebook comments

By the time of writing this chapter, the FB page covering instructions on how to set this up are here:

https://developers.facebook.com/docs/reference/plugins/comments/

To moderate, you need to list yourself as an admin. To do this, simply include open graph meta tags on the URL specified as the href parameter of the plugin. These tags must be included in the <head> of the document. Include:

<metaproperty="fb:admins"content="{YOUR_FACEBOOK_USER_ID}"/>
To add multiple moderators, separate the uids by comma without spaces.

If your site has many comments boxes, we strongly recommend you specify a Facebook app id as the administrator (all administrators of the app will be able to moderate comments). Doing this enables a moderator interface on Facebook where comments from all plugins administered by your app id can be easily moderated together. You can choose to specify either fb:app_id or fb:admins, but not both. This tag should be specified in the <head>.

<metaproperty="fb:app_id"content="{YOUR_APPLICATION_ID}"/>
You can moderate comments from just this plugin inline. If you have specified your app id as the admin, you can moderate all your plugins at http://developers.facebook.com/tools/comments.

First, you need to create an app on Facebook (https://developers.facebook.com/apps). You will then be able to customize options for look and feel of the comment form and comment listing, and to generate the embed code that requires your app id to use plugin on your pages.

<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_GB/all.js#xfbml=1&appId=your_app_id_here";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

This code goes into the <head> part of the html page, while on the place where you need comment form to appear you only need to put this:

<div class="fb-comments" data-href="{{ url options="article" }}" data-width="670" data-num-posts="10"></div>

Disqus comments

Disqus integration is pretty straightforward - after registering on their platform and submiting basic data about the website you're going to put Disqus comments on, you get embed code generated. 

<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: THIS CODE IS ONLY AN EXAMPLE * * */ 
var disqus_shortname = 'your_site_shortname'; // Required - Replace example with your forum shortname 
var disqus_identifier = '{{ $gimme->article->number }}'; // a unique identifier for each page where Disqus is present
var disqus_title = '{{ $gimme->article->name|escape }}'; // a unique title for each page where Disqus is present
var disqus_url = '{{ url options="article" }}'; // a unique URL for each page where Disqus is present
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>

This code goes where you want comments to appear (under the full article text).

More settings can be adjusted in the 'Settings' tab of your site's dashboard on Disqus. You can for example change color scheme, typeface, text shown for articles having 0 / 1 / 2 and more comments, community rules (moderation policy), social platforms integration etc. 

There has been error in communication with Booktype server. Not sure right now where is the problem.

You should refresh this page.