Fandom Developers Wiki

DiscussionsRailModule adds a rail module for Discussions to the rail, listing a feed of discussions posts for the wiki. The script offers the same configuration options.

<div class="discussions-rail-theme"></div>

Installation

Configuration

Embedding-only use

The script can be configured to deactivate the rail module and style the embedded module in articles, by using the window.discussionsModuleEmbed object in your wiki's MediaWiki:Common.js:

window.discussionsModuleEmbed = true;

Positioning

The Discussions rail module is positioned below the Wiki Activity modules when they're available, or appended to the bottom of the rail.

It is possible to adjust the module to any desired position by using the discussionsModule.added hook in your wiki's MediaWiki:Common.js.

For example, this code will position the module above the Insights module.

    mw.hook('discussionsModule.added').add(function($module) {
        // Module addition
        if ($('.insights-module').exists()) {
            $module.insertBefore('.insights-module');
        } else {
            $module.appendTo('#WikiaRail');
        }
    });

Post-processing

The module's contents can be changed after loading using the discussionsModule.loaded hook.

Styling

The header text is adjustable with the following CSS (replacing <TITLE> with your text):

.discussions-rail-theme .embeddable-discussions-module .embeddable-discussions-heading:after {
	content: '<TITLE>';
}

Content filtering

The feed content for the rail module is configured through the optional window.discussionsModuleConfig object, placed in MediaWiki:Common.js:

window.discussionsModuleConfig = {
	'size' : 'number 3-6',
	'mostrecent' : 'true/false',
	'catid' : [
		'first category id',
		'second category id',
		'etc.'
	]
}
Option Description Default
size

Number of posts in the post list.
Post minimum is 3, maximum is 6.

4
mostrecent Controls feed sorting by latest or trending posts.

Accepts true or false.

false
catid Specific categories to return posts from. None

Changelog

Date Notes Author
May 30, 2017 Initial revision. MACH-59330
May 31, 2017 Initial release on Fandom Developers Wiki. Rappy
June 23, 2017 Full rewrite of initial version. KockaAdmiralac
July 29, 2017 Addition of WDS spinner. MACH-59330
July 7, 2017 Addition of Discussions default avatar SVG. MACH-59330
July 29, 2017 Removal of .module class. MACH-59330
September 5, 2017 Object-based rewrite and feature additions.

Populating empty post titles (from Discussions alpha stage).
Cleanup of mutated arguments, nested functions & callbacks.

MACH-59330
November 29, 2017 I18n support for module header. MACH-59330
March 18, 2018 Content embedding patches, DRY for logic, preventing race conditions. MACH-59330
May 28, 2019 Compatible with FDS and the other rail-modules. TapeJIKa c ne4eHbKou
June 22, 2021 Rewrite to support UCP BoyAliveInside
Text above can be found here (edit)