討論版欄位模組(DiscussionsRailModule)在右側欄位為討論版添加一個欄位模組,它會列出在維基上的討論版動態,此腳本也提供與動態摘要標籤相同的配置選項。
<div class="discussions-rail-theme"></div>
安裝方法[]
組態[]
僅嵌入使用[]
此腳本能用來配置解除欄位模組並在條目上打造嵌入式模組,請在您的維基的 MediaWiki:Common.js 使用window.discussionsModuleEmbed
物件:
window.discussionsModuleEmbed = true;
定位[]
當您導入此腳本時,此討論版欄位模組會放在維基動態與論壇動態的下方。
但實際上,您可以在您的維基上的 MediaWiki:Common.js 使用discussionsModule.added
掛鉤將模組調整到所想要的位置上。
舉例而言,這個代碼會將模組放在熱點(Insights)模組的上方。
mw.hook('discussionsModule.added').add(function($module) {
// Module addition
if ($('.insights-module').exists()) {
$module.insertBefore('.insights-module');
} else {
$module.appendTo('#WikiaRail');
}
});
後期處理[]
此腳本的內容能在載入使用discussionsModule.loaded
掛鉤後變更。
造型[]
標題文字可透過以下的 CSS 進行修改(將<TITLE>
替換為您所輸入的文字):
.discussions-rail-theme .embeddable-discussions-module .embeddable-discussions-heading:after {
content: '<TITLE>';
}
篩選內容[]
欄位模組的摘要內容可透過window.discussionsModuleConfig
物件進行配置,請將它放置在 MediaWiki:Common.js :
window.discussionsModuleConfig = {
'size' : 'number 3-6',
'mostrecent' : 'true/false',
'catid' : [
'first category id',
'second category id',
'etc.'
]
}
選項 | 說明 | 預設 |
---|---|---|
size
|
顯示文章列表的文章數量 最小值為3,最大值為6 |
4
|
mostrecent
|
控制最新或熱門文章的摘要 可使用 |
false
|
catid
|
自文章返回時回到指定的分類上。 | 無 |
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). |
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 |