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. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> 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 https://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

16 Aug 2018 fixed some more perl errors
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
I Attachment Action Size Date Who Comment
DisqusPlugin.md5md5 DisqusPlugin.md5 manage 159 bytes 16 Aug 2018 - 08:16 MichaelDaum  
DisqusPlugin.sha1sha1 DisqusPlugin.sha1 manage 183 bytes 16 Aug 2018 - 08:17 MichaelDaum  
DisqusPlugin.tgztgz DisqusPlugin.tgz manage 5 K 16 Aug 2018 - 08:16 MichaelDaum  
DisqusPlugin.zipzip DisqusPlugin.zip manage 8 K 16 Aug 2018 - 08:16 MichaelDaum  
DisqusPlugin_installerEXT DisqusPlugin_installer manage 4 K 16 Aug 2018 - 08:16 MichaelDaum  
Topic revision: r6 - 16 Aug 2018, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy