查看“Template:Help:Template parameters”的源代码
←
Template:Help:Template parameters
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
用户
、
机器人
、Administrator、curator
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
Parameters are used to pass information to a template when it is embedded. Parameters allow the template to produce different contents or have different behaviors. Suppose you wish to insert a thank you note on a page with the name of the person being thanked embedded in the text. Create a template called "Template:Thankyou" as follows: <pre>Thank you for your help with the wiki {{{1}}}!</pre> You can then use this template by specifying the person's name as a parameter to it: <nowiki>{{Thankyou|Rick}}</nowiki> Notice the use of <code><nowiki>{{{1}}}</nowiki></code>. This is the way to identify, within templates, the parameters that will be passed in when the template is used. Note that, within the template, each parameter is surrounded by '''three''' braces: <code><nowiki>{{{ }}}</nowiki></code>. When using the template on a page, you fill in the parameter values, separated by a "pipe" character (<code>|</code>). The result will appear as: {{box|Thank you for your help with the wiki Rick!}} === Default parameter values === Suppose we add a second parameter to the last example, to say who the thank you is from. Such as: <pre>Thank you for your help with the wiki {{{1}}}!<br/> From {{{2}}}. </pre> If the template is called without the second parameter <nowiki>{{Thankyou|Rick}}</nowiki>, the result would be {{box|Thank you for your help with the wiki Rick!<br/> From .}} To avoid this situation, you can use a ''default'' parameter value inside the template. The output will take on this value if the parameter is not being passed. <pre>Thank you for your help with the wiki {{{1}}}!<br/> From {{{2|the wiki team}}}. </pre> Now if the template is called without the second parameter, the result would be {{box|Thank you for your help with the wiki Rick!<br/> From the wiki team.}}
本页使用的模板:
Template:box
(
查看源代码
)
返回
Template:Help:Template parameters
。
导航菜单
个人工具
中文
创建账号
登录
命名空间
模板
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
台灣正體
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首頁
Ashes of Creation
種族、職業
節點、經濟
大型副本、公會、戰鬥
裝備、房屋、坐騎
PvP, 攻城戰, 商隊
最新美術圖
最新報道
最新更新
隨機搜尋
加入我們
其他语言
العربية
Deutsch
English
español
français
עברית
magyar
italiano
Nederlands
polski
português
русский
工具
链入页面
相关更改
特殊页面
页面信息
社群
Wiki Discord
Wiki Discord bot
Wiki YouTube
Wiki forum popups