六月八日是什么星座| 甘油三酯高吃什么食物降得快| kda是什么单位| 什么窃什么盗| 笑口常开是什么生肖| 铁线虫是什么| 儿童乘坐飞机需要什么证件| 肚子大什么原因| 月经期间喝什么好排毒排污血| 为什么怀不上孩子| 脾的主要功能是什么| 武则天代表什么生肖| 离婚要什么手续| 狐仙一般找什么人上身| 实至名归是什么意思| 15号来月经排卵期是什么时候| 2014年属什么生肖| 9.27日是什么星座| 什么家欢乐| 三次元是什么| act是什么意思| 缺陷是什么意思| 什么是肝性脑病| 什么是棱长| 什么是高潮| 专班是什么意思| 白脸红脸代表什么| 什么的旋律| 肾病综合症是什么病| 是什么词性| 做b超为什么要憋尿| 什么的老虎| journey是什么意思| 迷惑是什么意思| 菊花有什么颜色| 凋零是什么意思| 9月23日是什么星座| 梦见车掉水里了什么征兆| 头晕恶心呕吐是什么原因| 嗓子痛挂什么科| 荨麻疹是什么症状| 拉屎是绿色的是什么原因| 为什么会乳糖不耐受| 巴适什么意思| 69是什么意思| 疱疹不能吃什么食物| 女人手脚发热吃什么药| 白痰咳嗽用什么药最好| 为什么老流鼻血| 脑白质病是什么病| roma是什么意思| 低钾有什么症状和危害| 花是什么意思| 根管治疗是什么| 乳腺结节3类什么意思| 一岁宝宝流鼻涕吃什么药| 邓紫棋和华晨宇什么关系| 声东击西什么意思| 上面一个山下面一个今读什么| 双向转诊是什么意思| 孩子疱疹性咽峡炎吃什么药| 血压高挂什么科| 断码是什么意思| 味极鲜是什么| 胰岛素偏低是什么原因| 转氨酶高是什么原因| 西辽国在现今什么地方| 梦见着火了是什么意思| pg在医学是什么意思| 活检是什么意思| 作践自己是什么意思| 荸荠读音是什么| 讳莫如深什么意思| 2028年是什么年| 流产吃什么药可以堕胎| 蹲久了站起来头晕是什么原因| 一直想吐是什么原因| 泡打粉是什么东西| 日本料理都有什么菜| 人生价值是什么| 升字是什么生肖| 粽子是什么意思| 肛周湿疹用什么药膏效果好| 紫茉莉什么时候开花| 粗钢是什么| 十二生肖各代表什么花| 一个口一个坐念什么| 天乙贵人什么意思| 先天性心脏病最怕什么| 石女是什么意思啊| 宫寒吃什么药| 晚霞是什么意思| 减肥不能吃什么| 肺气泡是什么病| 面基什么意思| 脘腹胀满是什么意思| 终而复始什么意思| 广州番禺有什么好玩的地方| 什么还珠| 为什么会胆汁反流| 芃字五行属什么| 小朋友手指脱皮是什么原因| 血尿酸偏高是什么原因| 血小板压积偏高是什么意思| 什么体质容易高原反应| 姌是什么意思| 生蚝什么时候最肥| 胃在什么位置| 铄字五行属什么| 本能是什么意思| 泌乳素什么时候查最准确| 止咳吃什么药| 什么生日的人有佛缘| 养鱼为什么养单不养双| 三十六计的第一计是什么| 狼吞虎咽的意思是什么| 三顾茅庐什么意思| 蓝光有什么作用| 眼眶发青是什么原因| 什么乎乎| 地方是什么意思| 外耳道炎用什么药| 子癫是什么病| 白带过氧化氢阳性是什么意思| 什么的天空飘着什么的白云| 干咳嗽无痰是什么原因| 耘是什么意思| 高钾血症是什么原因引起的| 什么动物不怕热| 牡蛎是什么| 阳痿早泄是什么原因| 两特两重指的是什么| 什么是富氢水| 一直不来月经是什么原因| 右眼跳什么| 血稠是什么原因| 什么的雾霾| 精不液化是什么原因导致的| 服务是什么意思| 急性肠胃炎吃什么食物| 1997是什么年| 血脂稠吃什么食物好| 腋下淋巴结挂什么科| 暗物质是什么| 脸上长毛什么原因| 不解之谜的意思是什么| 张起灵和吴邪什么关系| 女人细菌感染什么原因引起的| 9月什么星座| 六月二十九日是什么星座| 扒皮是什么意思| 烧钱是什么意思| 备货是什么意思| 打耳洞去医院挂什么科| 什么木头有香味| 淋巴结肿大吃什么食物好| 左室高电压什么意思| 魁拔4什么时候上映| c14呼气试验是检查什么的| 苋菜不能和什么一起吃| 毛豆子炒什么好吃| 肚子疼是什么原因一阵一阵的| 天蝎是什么动物| 马蜂蛰了用什么药| 陈皮配什么喝去湿气| 打喷嚏是什么意思| 什么果酒最好喝| 目赤什么意思| 锦五行属什么| 肝内小钙化灶是什么意思| 梦见吃葡萄是什么意思| 缺钾会有什么症状| 解大便时有鲜血流出是什么原因| 莺是什么鸟| 小麦什么时候成熟| 吃多了拉肚子是什么原因| 蒲公英有什么药效| 胸闷什么原因| 苦肠是什么部位| 苏轼是什么之一| 眼睛散瞳有什么危害| 登徒子什么意思| 慰劳是什么意思| 肾功能不全是指什么| 11月26是什么星座| 一个山一个空念什么| 吃什么长胖| 鳕鱼是什么鱼| 什么汤好喝| 胖大海是什么东西| 印度尼西亚是什么人种| 4月10日是什么星座| 4月2号是什么星座| 什么是奇点| 蒲公英和什么搭配最好| 梦见和老公结婚是什么意思| 庸人自扰什么意思| 双肾实质回声增强是什么意思| 跖疣挂什么科| 40周年是什么婚| 什么环境唱什么歌原唱| 可字五行属什么| 初代是什么意思| 阑尾在人体的什么位置| 糙皮病是什么病| 瓠子和什么相克| 前列腺炎是什么| 什么大牌护肤品好用| 毛戈平属于什么档次| 什么是全脂牛奶| 2月15号是什么星座| wonderful什么意思| 聚乙烯醇是什么材料| 吃什么补雌激素| 氨气是什么| 尿酸碱度是什么意思| 嗓子疼吃什么消炎药| 高血糖适合吃什么主食| 四季常青财运旺是什么生肖| 人老是放屁是什么原因| 白蜡烛代表什么| 红粉是什么意思| 慎重的意思是什么| 逾越节是什么意思| 梦见衣服是什么意思| 什么化妆品好| 藏红花能治什么病| 风起云涌是什么生肖| 尿路感染是什么原因引起的| 什么的大自然| 情字五行属什么| 贪慕虚荣是什么意思| 偏光眼镜是什么意思| 韭黄炒什么好吃| 红楼梦什么朝代| 结核是什么病| 梦见买床是什么意思| 什么样的你| 孩子脾虚内热大便干吃什么药| 10月17日什么星座| 降低压吃什么药| 亮剑是什么意思| 左眼皮老是跳是什么原因| 低血压吃什么补得最快| skll什么牌子| 为什么榴莲那么贵| 毛骨鱼是什么鱼| 水泡用什么药膏最有效| 割礼是什么意思| 耳朵嗡嗡响吃什么药| 凤凰是什么生肖| 胃不好看什么科| 孕妇吃什么蔬菜好| 试管是什么| 子宫内膜炎是什么原因造成的| 下巴长痘是为什么| 西南属什么五行| 反复口腔溃疡是什么原因| 司命星君掌管什么| 脂蛋白a高是什么原因| 自行是什么意思| 肚脐周围是什么器官| 补肺养肺吃什么食物最好| 喝什么茶最养胃| 百度Jump to content

政府单位受邀倾力打造中国应急救灾展公益活动

Page semi-protected
From Wikipedia, the free encyclopedia
百度   为了满足生活的需要,“上海第一人”们因地制宜地发展了水稻种植。

This page not to be confused with Template:Namespaces
Namespaces
Subject namespaces Talk namespaces
0 (Main/Article) Talk 1
2 User User talk 3
4 Wikipedia Wikipedia talk 5
6 File File talk 7
8 MediaWiki MediaWiki talk 9
10 Template Template talk 11
12 Help Help talk 13
14 Category Category talk 15
100 Portal Portal talk 101
118 Draft Draft talk 119
126 MOS MOS talk 127
710 TimedText TimedText talk 711
828 Module Module talk 829
1728 Event Event talk 1729
Former namespaces
108 Book Book talk 109
442 Course Course talk 443
444 Institution Institution talk 445
446 Education Program Education Program talk 447
2300 Gadget Gadget talk 2301
2302 Gadget definition Gadget definition talk 2303
2600 Topic 2601
Virtual namespaces
-1 Special
-2 Media
Current list

The Template namespace on Wikipedia is used to store templates, which contain Wiki markup intended for inclusion on multiple pages, usually via transclusion. Although the Template namespace is used for storing most templates, it is possible to transclude and substitute from other namespaces,[1] and so some template pages are placed in other namespaces, such as the User namespace.

Templates help maintain consistent formatting and aid navigation between articles. They often include optional and/or variable elements controlled by parameters to allow for specialized use. Templates are also used to assist in a large variety of Wikipedia maintenance tasks. Each template has a matching Template talk: page where editors can discuss the design and implementation of the associated template (see Help:Using talk pages for how to participate in talk page discussions).

A template is transcluded into another page by including a template tag in that page's content. A template tag contains the template page name surrounded by double curly braces, e.g. {{Disambiguation}}. If the template's page name does not begin with a namespace and colon, it is assumed to be in the Template namespace.

Internal links to template pages may be made by using the Template: prefix, e.g. [[Template:Disambiguation]]. See § Linking to templates for other ways to link to a template.

Guidelines

  • Templates should not normally be used to store article text, as this makes it more difficult to edit the content. They should also not be used to "collapse" or "hide" content from the reader.
  • Templates used in articles are designed to provide information to assist readers, such as navigation aids, formatting, or warnings that content is sub-standard. Templates that provide information only of service to editors should not appear on article pages – use the article's talk page or other non-article namespaces.
  • Template function should be clear from the template name, but redirects can be created to assist everyday use of very popular templates.
  • High-risk templates should be semi-protected, template protected, or fully protected as appropriate (see Wikipedia:Protection policy). This applies also to any high-use template redirects.
  • Templates should be clearly documented as to their usage and scope.
  • Templates should not be used to create lists of links to other articles when a category, list page, or "See also" section list can perform the same function.
  • Templates for short, temporary messages that will be removed quickly (such as on User_talk: pages) or that contain text which is not likely to ever be changed should be invoked with substitution (subst:). Typical templates that are intended for long-term use and are likely to require changes should be transcluded for easy future updates.
  • Templates that violate the guidelines on this page, have poorly defined function, are redundant, become orphaned or used on only one page, or violate any Wikipedia policies may be nominated for deletion at Wikipedia:Templates for discussion.

Linking to templates

Internal links to template pages may be made by using the Template: prefix or its alias TM:, e.g. [[Template:Disambiguation]] or [[TM:Disambiguation]]. These links go to a page that directly contains a base template, but subpages such as the template's documentation can be linked directly as well, e.g. [[Template:Disambiguation/doc]].

To link to a template using a display format appropriate for templates, use Template:Tl (short for "template link"). For example, to reference the Cleanup template, typing {{tl|Cleanup}} results in {{Cleanup}}. This does not call the template, but the display clearly indicates that the linked object is a template. You can also add parameters using Template:Tlp; for example, {{tlp|Convert|1|m}} displays as {{Convert|1|m}}. Check the template documentation on Template:Tl for other options, such as {{tlb}} (bold), {{tlx}} (code), {{tlxi|param1|param2}} (italic parameters), {{tnl}} (no link), and many more.

Suggested practices

Template names

Template names should be made of one or more words, such as {{Train topics}}. The first character is not case-sensitive, so {{cleanup}} and {{Cleanup}} are the same template. All other characters are case sensitive, so {{cfd}} and {{cfD}} are not the same. Template names are easiest to remember if they follow standard English spelling, spacing, and capitalization (also see the naming conventions for articles). Avoid having templates whose names differ only in case, spacing, or punctuation.

For templates with long names, template redirects (often called shortcuts) can be created for ease of typing. For example, instead of typing {{Template link with subst}} the shortcut {{tls}} is available.

Sandbox for experiments

If you wish to experiment with templates (and not have your experiments deleted before you are done with them), you may do so in the Template sandbox. You may also use the templates X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, and X12 for experimental purposes. To include a test template, use the form {{X1}} for template X1, {{X2}} for template X2, etc.

Existing templates often each have their own sandbox and test case pages (especially those that use {{Documentation}}). Changes should be thoroughly tested there before being applied to the main template, in order to prevent unintentional damage to many pages.

Readability of the code

For templates that have a large number of parameters, it can be helpful to place each parameter on a separate line and align the equals signs. This helps future editors to more easily read the wikicode. For example, if you wish to create a new infobox – which may contain dozens of parameters – your code might look like this:

{{Infobox
| header1  = Text of header1
| label2   = Text of label2
| data2    = Text of data2
| etc      = etc
}}

Templates using many conditional expressions often benefit from line spacing, such as the following code used in {{If either}}

{{#if:{{{1|}}}
 |{{{then|{{{3|}}}}}}
 |{{#if:{{{2|}}}
  |{{{then|{{{3|}}}}}}
  |{{{else|{{{4|}}}}}}
 }}
}}

While not necessary, the demonstrated linebreaks allow for easier parsing of which conditionals relate to which #if statement.

Line breaks

While line breaks in the body of a template code are useful for readability, line breaks at the beginning or end of template code could cause display issues on articles. Care should be taken when coding templates to ensure that there is no unnecessary whitespace. A single line break in an infobox may combine with a line break in an article to cause a paragraph break, or could cause an unwanted template in an inline template. As a general guideline, avoid two line breaks together in your template. These may "add up" with other line breaks in the article and be displayed as unwanted white space. For more information about line breaks as they affect wikitext, see Wikipedia:Line-break handling.

To avoid unnecessary whitespace, ensure that any <noinclude> tags are placed immediately after the template code. The following code is from {{questions}} and has good line break management.

{{notice|small=yes|If you want to ask a question, please see the [[Wikipedia:Questions]] page for guidance.}}<noinclude>
[[Category:Wikipedia help templates]]
</noinclude>

Substitution

Invoking a template using the form

{{subst:Template name |Parameter1 name}}

(that is, inserting subst: immediately after the opening pair of curly brackets) will make a copy of the template text and place it on the page, where it will be viewable in the source. The template is no longer transcluded and future changes to the template will not change the text. As a guideline, this method should be used for any short, temporary messages which are removed quickly, such as on User_talk: pages. The standard new user {{subst:Welcome}} message is a good example.

Use subst: also if you need to edit the message after including it on the page. If you don't need to edit it, and would rather the message is automatically updated along with changes made to the template, don't use subst:.

Documentation

Because templates represent a step up in difficulty for the novice editor, documentation should be provided which describes its usage (optional parameters) and scope (where it should be used). There are two different ways to do this:

One option is to use the {{documentation}} template to add a minor description directly onto the template page. As mentioned in § Line breaks, the first <noinclude> tag should be placed on the same line as the last character of the actual template. For example:

'''This is a {{{1}}} article.'''<noinclude>
{{documentation|content=
Place this template on any article that requires description. It 
takes one parameter, an adjective used to describe the article. 
For example, {{article-describe|bad}} produces the text, 
'''This is a bad article.'''
}}
</noinclude>

Another alternative is to create a formal /doc subpage for the documentation (preferred for templates with multiple parameters, etc.). The {{documentation}} template is still called, but all of the displayed text will be transcluded from the template's /doc subpage.

'''This is a {{{1}}} article.'''<noinclude>
{{documentation}}
</noinclude>

Modules

Lua modules are sometimes used instead of templates to store reusable material. Reasons for this include usage of module-specific features such as loops or stored values, and complex code is often easier to read and maintain in a module. If a module is easily implementable in a template it generally should be, since there are more users with experience editing templates.

If a module is intended to be used in articles or talk pages, a template wrapper should generally be created to simplify usage without directly requiring the {{#invoke}}: parser function. Documentation is then mostly located on the template's /doc page, with the module's documentation pointing to the template and/or explaining further technical details that are unnecessary at the primary template documentation.

A template wrapper uses more of the post-expand include size limit than calling the module directly, therefore it may be necessary to avoid using one in articles that are near the limit.

History

Historically, an "msg:" prefix had to be added in front of the template name when it was used on a page. For example, {{msg:stub}} was typed instead of {{stub}}. This is no longer necessary.

In Wikipedia's first 35 months, there was no template or transclusion mechanism at all. The page Wikipedia:Boilerplate text was created in September 2002 to collect frequently used text in various Wikipedia processes. The MediaWiki namespace was introduced with MediaWiki 1.2.6 on December 6, 2003, and was used not only for the user interface but also for creating boilerplate text messages to be inserted in articles using the {{msg: ...}} syntax. This function was replaced with the Template namespace during the software upgrade to MediaWiki 1.3 on May 30, 2004. As a function of the "Template namespace initialisation script", all non-system messages were moved to the new namespace. The initialisation script also replaced MediaWiki: references in articles with Template: to bypass the redirects created by the moves.

For a short time, Wikipedia:Articles for deletion (then known as votes for deletion or VfD) used MediaWiki: messages named in the format "MediaWiki:VfD-articlename". These were moved to the Template: space in June 2004 and were named "Template:VfD-articlename". This usage is deprecated now in favor of subpages.

Around 2005, growing complexity of template functions and the desire to consolidate similar templates led to the creation of extremely complex conditional hacks such as nested templates and CSS tricks. These undesirable methods led to the development of m:Extension:ParserFunctions, added in 2006 with MediaWiki 1.7. By 2009, many problems with template readability and complexity still remained (On templates and programming languages). In 2013, in order to address page load times, mostly due to slow template renders, Lua was enabled, creating a Module: namespace for programmers to make use of (New Lua templates bring faster, more flexible pages to your wiki).

Searching for templates

Use this form to search in the Template: or Template_talk: namespaces. See Help:Searching for more information.

Pages which contain information on commonly used templates:

If you're unable to find an existing template for your situation, but don't feel comfortable creating one yourself, you can ask for help at Wikipedia:Requested templates.

See also

Notes

  1. ^ Namespaces from which transclusion is not allowed are specified on a wiki by the variable $wgNonincludableNamespaces
焦糖色是什么颜色 正月二十是什么星座 泰国是一个什么样的国家 卵黄囊是什么意思 肋骨骨折吃什么食物好得快
猪狗不如是什么意思 什么是石女 什么是聚酯纤维面料 什么是肺结核 心电图诊断窦性心律什么意思
血压高喝什么茶 艾滋病的症状是什么 月亮星座是什么意思 标准偏差是什么意思 常务理事是什么职位
孕妇为什么要躲着白事 mfr是什么意思 蜻蜓喜欢吃什么 喝酒容易醉是什么原因 类风湿关节炎吃什么药
我国四大发明是什么hcv9jop0ns5r.cn 什么是碳水hcv8jop6ns3r.cn 粥米是什么米hcv9jop3ns2r.cn 淋巴结增大是什么原因严重吗hcv9jop8ns2r.cn 圣代是什么hcv8jop0ns0r.cn
一纸空文是什么意思gangsutong.com 青鱼吃什么fenrenren.com 吃了发芽的土豆会有什么症状hcv9jop0ns9r.cn 右耳朵疼是什么原因hcv9jop8ns3r.cn 乳腺回声不均匀是什么意思hcv7jop6ns4r.cn
9月14是什么星座hkuteam.com 病假需要什么医院证明hcv9jop5ns5r.cn 肌肉痛是什么原因dajiketang.com 想吃咸的是身体缺什么jingluanji.com 扒皮是什么意思hcv7jop4ns6r.cn
生殖疱疹吃什么药不复发hcv8jop9ns4r.cn 闲鱼转卖什么意思hcv8jop5ns3r.cn 心血管堵塞吃什么药hcv9jop2ns8r.cn 柱镜度数是什么意思hcv8jop1ns2r.cn 亡羊补牢的寓意是什么hcv8jop9ns8r.cn
百度