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.
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 |
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