模板:Special wikitext/Custom Module/doc

出自Local Chinese Wikipedia
跳至導覽 跳至搜尋

本模板文件主要用於require('Module:Module wikitext')._addTextModule:Module wikitext)中,用於客製化模組命名空間。

本模板不能直接使用,需要透過Module:Special wikitext/Custom Module間接調用。使用方法為複製以下代碼到要客製化的模組中:

require('Module:Module wikitext')._addText([[{{#invoke:Special wikitext/Custom Module|main|is_in_doc={{{is_in_doc|0}}}
|pagename=必須輸入所在的頁面名稱以防止模板循環
|wikitext=

要自定義模組頁面的維基代碼

可選參數:
|show_doc=是否顯示說明檔案}}]]
)

防止模板循環[編輯]

如果上述設置仍無法防止模板循環,即模組或調用模組的頁面出現以下錯誤:

可考慮改用以下代碼:

require('Module:Module wikitext')._addText([[{{ {{#ifeq:{{FULLPAGENAME}}|必須輸入所在的頁面名稱以防止模板循環|#invoke:Special wikitext/Custom Module|void}}|main|is_in_doc={{{is_in_doc|0}}}
|pagename=必須輸入所在的頁面名稱以防止模板循環
|wikitext=

要自定義模組頁面的維基代碼

可選參數:
|show_doc=是否顯示說明檔案}}]]
)

模板數據

以下是該模板的模板資料,適用於視覺化編輯器等工具。

Special wikitext/Custom Module模板資料

<TemplateData>{ "description": "用於自定義模組命名空間中頁面的內容。在非模組命名空間沒有作用", "params": { "is_in_doc": { "label": "防止模板循環的必要參數", "description": "必須填入0", "example": "0", "type": "line", "suggestedvalues": [ "0" ], "default": "0", "autovalue": "0", "required": true }, "show_doc": { "label": "顯示說明檔案", "description": "是否顯示模組說明檔案", "type": "boolean" }, "wikitext": { "label": "維基代碼", "description": "自定義模組頁的維基代碼", "type": "content", "required": true }, "pagename": { "label": "所在的頁面名稱", "description": "為了防止模板循環,必須輸入所在的頁面名稱。本模板只會在輸入的位置上顯示。", "type": "wiki-page-name", "required": true } }, "format": "block" }</TemplateData>

參見[編輯]