跳转到内容

Template:Talkspace detect/doc

维基百科,自由的百科全书

这是本页的一个历史版本,由RalfX留言 | 贡献2009年9月8日 (二) 03:13 建立内容为“<includeonly><!-- 在這裡加入模板的保護標識 --></includeonly> {{Documentation subpage}} <!-- 在本行下編輯模板說明 --> The {{tl|ta...”的新頁面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

The {{talkspace detect}} meta-template helps other templates detect what type of page they are on. It detects and groups all the different talkspaces used on Wikipedia into several types:

main = Defines the output if the template is located on main/article talkspace; aka Talk:.
user, wikipedia, file, mediawiki, template, help, category and portal = Defines the output if the template is located on the specified talkspaces; aka User talk:, Wikipedia talk:, File talk:, etc.
default = Defines the output if the template is located on any talkspaces that were not defined as a parameter in this meta-template.
other = Defines the output if the template is located on any namespaces (not the associated talkspace).

用法

This template takes one or more parameters named after the different page types as listed above. Like this:

{{talkspace detect
| main    = 條目討論頁文字
| user    = 用戶討論頁文字
| default = 其他所有討論頁面文字
| other   = 一般名字空間文字
}}

By using an empty parameter you can make it so the template doesn't render anything for some specific page type. Like this:

{{talkspace detect
| main    = 
| default = Text for all other namespace talk pages
}}

參見

便於偵測命名空間的模板群:

更複雜的命名空間偵測模板:

Technical stuff: