TIP DisqusPlugin is not installed on Foswiki.org.

DisqusPlugin

Disqus-based commenting system

DisqusPlugin allows to embed the popular DISQUS commenting system to Foswiki. This is mostly of use when running a public site on the internet to allow a wider range of people to comment on your site. Instead of requiring them to register and log in to your site, they can use their existing Disqus, Facebook, google+ or twitter identity already authenticated on the net.

Note that all comments will be stored on disqus.com, not on your own server. There are however APIs to import and export this data. Further note that you will have to register an account on disqus.com and register your Foswiki site. The generated short name for your site then has to be stored in {DisqusPlugin}{ForumName}. All maintenance of comments including moderation is done via disqus.com as well, not on your own site.

Use %!DISQUS% on any page to start a discussion on that page.

Use %!DISQUS_COUNT% to display the number of comments on page.

DISQUS -- embed a discussion

This will embed all required javascript code to the page so that it loads the disqus widget on page load.

Parameters Description Default
[topic] the topic to render the discussion for current topic
title the title to be used for that discussion title of the html page
url the location of the page hosting this discussion the current view url

DISQUS_COUNT -- display number of comments on a given topic

This is mostly useful when rendering a list of topics with discussions and add the number of comments for each.

Parameters Description Default
[topic] the topic to render the counter for current topic
format markup template to be used <a href="$url" class="disqus_count" data-disqus-identifier="$id"></a>

Skin integration

DisqusPlugin is already integrated into Foswiki:Extensions/NatSkin's pluggable commenting system. Use the COMMENTSYSTEM preference variable to switch it to disqus.

Installation Instructions

See also comments above.

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Content Security Policy

If you are using DisqusPlugin together with SecurityHeadersPlugin you will have to adjust the policy as follows:

  • add *.disqus.com *.disquscdn.com to script-src
  • add *.disqus.com *.disquscdn.com to style-src
  • add *.disqus.com to connect-src

You might see related error reports in the javascript console of your browser as well as CSP-reports in the server logs in case you configured report-uri in the SecurityHeadersPlugin's configuration.

This will look like this for instance:

$Foswiki::cfg{Http}{ContentSecurityPolicy}{"script-src"} = "'self' *.disqus.com *.disquscdn.com";
$Foswiki::cfg{Http}{ContentSecurityPolicy}{"style-src"} = "'self' *.disqus.com *.disquscdn.com";
$Foswiki::cfg{Http}{ContentSecurityPolicy}{"connect-src"}= "'self' *.disqus.com"; 

Dependencies

None

Change History

25 Aug 2015 added docu on content security policy
31 Aug 2015 ignore discussions in template (_) webs
16 Dec 2014 make it work with async page loads as per AngularSkin
5 May 2013 initial release
Topic revision: r5 - 25 Sep 2015, MichaelDaum - This page was cached on 25 May 2016 - 13:23.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License