mNo edit summary |
m (Rappy renamed.) |
||
Line 108: | Line 108: | ||
:[[User:MACH-59330|MACH-59330]]: Initial revision. |
:[[User:MACH-59330|MACH-59330]]: Initial revision. |
||
;May 31, 2017 |
;May 31, 2017 |
||
− | :[[User:Rappy |
+ | :[[User:Rappy|Rappy]]: Initial release on {{SITENAME}}. |
;June 23, 2017 |
;June 23, 2017 |
||
:[[User:KockaAdmiralac|KockaAdmiralac]]: Full rewrite of initial version. |
:[[User:KockaAdmiralac|KockaAdmiralac]]: Full rewrite of initial version. |
Revision as of 10:46, 21 September 2020
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 as the activity feed tag.
If you import the script, you can use the feed design on any article by placing the <discussions />
tag in the same wrapper:
<div class="discussions-rail-theme">
<discussions />
</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:Wikia.js:
window.discussionsModuleEmbed = true;
Positioning
The Discussions rail module is positioned below the Wiki Activity or Forum 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:Wikia.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:Wikia.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. |
4
|
mostrecent
|
Controls feed sorting by latest or trending posts. |
false
|
catid
|
Specific categories to return posts from. | None. |
The help page for the Discussions activity feed has further guidance on how the configuration options work.
Updates
Changelog
- May 30, 2017
- MACH-59330: Initial revision.
- May 31, 2017
- Rappy: Initial release on Fandom Developers Wiki.
- June 23, 2017
- KockaAdmiralac: Full rewrite of initial version.
- July 29, 2017
- MACH-59330: Addition of WDS spinner.
- July 7, 2017
- MACH-59330: Addition of Discussions default avatar SVG.
- July 29, 2017
- MACH-59330: Removal of
.module
class.
- September 5, 2017
- MACH-59330: Object-based rewrite and feature additions.
- Populating empty post titles (from Discussions alpha stage).
- Cleanup of mutated arguments, nested functions & callbacks.
- November 29, 2017
- MACH-59330: I18n support for module header.
- March 18, 2018
- MACH-59330: Content embedding patches, DRY for logic, preventing race conditions.
- May 28, 2019
- TapeJIKa c ne4eHbKou: Compatible with FDS and the other rail-modules.
TO-DO:
- Color adjustment for default Discussions avatar.