Template:Special wikitext/Custom Module/doc

维基百科,自由的百科全书
跳转到导航 跳转到搜索

本Template文档主要用於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>

參見[编辑]