参考自MediaWiki Handbook:[url]http://meta.wikimedia.org/wiki/Help:Template#Parameters[/url]
The template namespace is the namespace with prefix “Template:”.
模板的名空间以“Template“为前缀.
A page in this namespace is called a template. The contents of such a page (either fixed or depending on parameters and/or variables) is designed to be useful for insertion in other pages (transclusion, creating a compound document).
The syntax for insertion of the page “Template:name” is {{name}}. This is called a template tag.
插入模板的标记是{{name}} “Template:name“
This reference in the wikitext causes insertion of the template content when the referring page is rendered. Various equivalent terms are:
calling the template 调用模板
referring to the template 涉及模板
including the template 包含模板
If the page “Template:name” does not exist, then {{name}} works as [[Template:name]], a link to a non-existing page, leading to the edit page. Thus, one way of making a template is putting the tag first, and then following the link.
如果”Template:name”不存在,那么{{name}}则链接到一个不存在的页面,可供编辑,这也是建立模板的一个方法.
If name starts with a valid namespace prefix, or a colon, then it is not prefixed with “Template:”. This way any page can be used as template (a colon at the start refers to the main namespace). In the case of an image or category, it gives the description part. Using a page outside the template namespace as template can be useful for:
如果name以其他有效的名空间为前缀,这样任何的页面可以用作模板.在模板名空间外使用页面有时候很有用:
quoting interface messages in the MediaWiki namespace 提供mediawiki名空间消息接口
experimenting with templates in subpages of one’s userpage 在用户子页面测试模板,“沙盒“
using the description of an image for a caption 把一个图片的描述用作标题
A template only works when referred to from a page in the same project. To use it in another project, one has to copy it to there.
模板只能在本工程中使用,如果要在外部工程中引用必须复制过去
As usual the name is case sensitive except (on most projects) for the first letter, and a blank space is equivalent with an underscore.
一般来说,大多数工程中名字首字母是区分大小写的,一个空格等同于下划线
Recursive inclusion is possible.
递规包含是可以实现的
A variable in a template is evaluated after insertion in the referring page, i.e. if {{PAGENAME}} occurs in the wikitext of a template, it is rendered as the name of the referring page, not the name of the template.
一个模板变量在插入一个页面后会被评估,如果在一个模板的wikitext中出现{{PAGENAME}},它被认为是一个普通页面链接,而不是当作一个模板的名字.