template Other

文档图示 模板文档

This is the {{template other}} meta-template.

It helps other templates detect if they are on a "Template:" page or some "other" type of page.

用法

This template usually takes two parameters, like this:

{{template other | Template page text | Other pages text }} 

If the template is on a "Template:" page, it will return this:

    Template page text

If the template is on any other page, it will return this:

    Other pages text

A typical usage case could be to make it so that a template only adds a category when not on a template page. Thus not adding the template itself and other templates that are built with it to the category. Like this:

{{template other | | [[Category:Some maintenance category]] }} 

Note that in the example above the "template" parameter was left empty.

Demospace

For testing and demonstration purposes this template can take a parameter named demospace.

  • If it has the value template it returns the template page text.
  • It if has the value other or any other value such as the name of some other namespace it returns the other pages text.
  • If the parameter is empty or undefined, the actual page type determines the result.

Like this:

{{template other  | Template page text  | Other pages text  | demospace = template }} 

No matter on what kind of page the code above is used it will return this:

    Template page text

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:

{{template other  | Template page text  | Other pages text  | demospace = {{{demospace|}}} }} 

Technical details

This template detects "Template talk:" pages as type other.

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

參見

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

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

  • {{main talk other}} – 區分某些命名空間。
  • {{main talk category other}} – 區分某些命名空間。

Technical stuff:

Tags:

🔥 Trending searches on Wiki 中文:

填詞L劉煥榮王心凌王漢斌 (演員)生死時速2黃劍文抖音胡耀邦李登輝SATA12怪盜雅虎宫崎骏太永浩三体 (中文剧集)林舒語费南多小彤三流之路賭場風雲繁花 (電視劇)Reddit周庭杜燕歌韓孝周雲浩影Eye Love YouLisa (泰國歌手)2024年西班牙馬德里羽球大師賽香港快運航空Linux內核尼泊尔ITZY王洪文乌鲁木齐七五事件郭文贵唐朝哥吉拉 II 怪獸之王但願人長久 (電影)再見·枕邊人耶稣埃隆·马斯克−2台鋼雄鷹艾莎·冈萨雷斯诸葛亮MIRROR (組合)YouTube澳大利亚世界各国和地区面积列表以色列—哈馬斯戰爭毒蠻牛事件脱氧核糖核酸河北彩花SlaxRadio Cross Days臨時劫案2026年國際足協世界盃安俞真劇場版 排球少年!! 垃圾場的決戰苍兰诀迈克尔·杰克逊中越战争Aespa梁启超2024年西班牙馬德里羽毛球大師賽歡迎來到實力至上主義的教室 (動畫)薄熙来唐納·川普伊斯兰国Mozilla趙麗穎HYBE江西省2024年3月Zi.U🡆 More