Jump to content

Extension:SectionDisqus

From mediawiki.org
MediaWiki extensions manual
SectionDisqus
Release status: beta
Implementation Ajax
Description Adds a "Discuss" button next to the "Edit" button of every section, that opens a Disqus thread for that section.
Author(s) Sophivorustalk
Latest version 3.0 (2018-02-11)
MediaWiki 1.25+
PHP 5.3+
Database changes No
License GNU General Public License 3.0 only
Download
  • $wgSectionDisqusShortname
Quarterly downloads 1 (Ranked 136th)
Translate the SectionDisqus extension if it is available at translatewiki.net

The SectionDisqus extension adds a "Discuss" button next to the "Edit" button of every section (including subsections), that when clicked, opens a Disqus thread for that section, inside a jQuery UI dialog (similar to a lightbox). In other words, this extension assigns a different Disqus thread to each section, allowing to discuss each section individually.

Warning! When a user changes the title of a section, the discussion associated with it will get lost, or more precisely, unlinked. This is because Disqus tracks discussions by associating them with a unique identifier, which is usually the URL of the page with the discussion. But because this extension allows for many discussions in the same page, a different identifier needs to be provided for each. The way the extension accomplishes this is by appending the section title to the URL. As a consequence, when the section title changes, the discussion linked to it will change too. If you can think of a solution to this problem, please let the author know, or better yet, fix it yourself. ;-)

Installation

[edit]
  • Download and move the extracted SectionDisqus folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SectionDisqus
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'SectionDisqus' );
    $wgSectionDisqusShortname = 'your-disqus-shortname';
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
For compatibility with Extension:DisqusTag, if $wgDisqusShortname is set, SectionDisqus will fallback to it if $wgSectionDisqusShortname is not set.

See also

[edit]