模板:Talk other/doc:修订间差异

来自SS唯基
跳到导航 跳到搜索
(创建页面,内容为“{{Documentation subpage}} This is the {{tl|talk other}} meta-template. This template helps other templates detect if they are on a talk page or some "other" type of...”)
 
(修改)
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
{{Documentation subpage}}
{{Documentation subpage}}
This is the {{tl|talk other}} meta-template.
This is the talk other meta-template.


This template helps other templates detect if they are on a talk page or some "other" type of page.
This template helps other templates detect if they are on a talk page or some "other" type of page.
第72行: 第72行:
This template detects all types of talk pages as type '''talk'''. That is, "Talk:", "User talk:", "File talk:" and so on are all of type '''talk'''.
This template detects all types of talk pages as type '''talk'''. That is, "Talk:", "User talk:", "File talk:" and so on are all of type '''talk'''.


This template works like {{tl|main talk other}}, for more examples and technical details see full documentation there.  
This template works like main talk other, for more examples and technical details see full documentation there.  


[[Category:元模板]]
[[分类:元模板]]

2022年8月31日 (三) 12:20的最新版本

Edit-copy green.png 本文档是模板:Talk other的模板文档子页面。
本页包含用法信息、分类等内容。


This is the talk other meta-template.

This template helps other templates detect if they are on a talk page or some "other" type of page.

用法

這模板包含兩個參數,像這樣:

{{talk other |討論頁產生文字|其他頁產生文字}}

如果把這模板放在討論頁上,模板返回:

討論頁產生文字

如果把這模板放在其他頁面上,模板返回:

其他頁產生文字

A typical usage case could be to make it so that a template only adds a category when on talk pages. Thus not adding other pages that just show the template. Like this:

{{talk other | [[Category:Some talk page category]] }}

Or to warn that a template should not be used on other pages:

{{talk other | | This template should only be used on talk pages. }}

Note that in the first case above the "other" parameter was not used, and in the second example the "talk" parameter was left empty.

Demospace

為進行測試和示範,這模板有一個參數名為demospace

  • 如果值為talk,則返回討論頁產生文字。
  • 如果值為other或其他值,則返回其他頁產生文字。
  • 如果參數為空或未被定義,頁面決定結果。

像這樣:

{{talk other 
|討論頁產生文字
|其他頁產生文字
|demospace = talk
}}

無論在什麼頁面都會返回:

討論頁產生文字

You can make it so your template also understands the demospace parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:

{{talk other 
| Talk pages text 
| Other pages text 
| demospace = {{{demospace|}}}
}}

Technical details

This template detects all types of talk pages as type talk. That is, "Talk:", "User talk:", "File talk:" and so on are all of type talk.

This template works like main talk other, for more examples and technical details see full documentation there.