跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
代码酷
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
未登录编辑者的页面
了解详情
贡献
讨论
编辑“︁
模板:Wikidata/doc
”︁(章节)
模板
讨论
大陆简体
阅读
编辑源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
编辑源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
您的更改会在有权核准的用户核准后向读者展示。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
== Advanced usage == The layout of the output from (a combination of) commands that have both a singular and a plural form (e.g. <code>property</code>/<code>properties</code>) can be customized by using a number of named flags, which are name-value pairs (i.e. <code>|flag=value</code>), that can be given anywhere {{module other|after the first command|inside the call}}. The table below shows the available named flags. To insert a space at the beginning or end of a <code>value</code>, use an underscore <code>_</code>. To get a literal underscore, escape it by placing a backslash <code>\</code> directly in front of it (i.e. <code>\_</code>); the same holds for a literal backslash (i.e. <code>\\</code>). To get a literal vertical bar <code>|</code>, use <code>{{tl|!}}</code> or <code>&#124;</code>. {| class="wikitable" |- ! Named flag ! Default value ! Default condition ! Description |- ! rowspan="6" style="text-align:right;" | <code>format=</code> | <code>%p[%s][%r]</code> | if the <code>property</code>/<code>properties</code> command '''was''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was not''' given | rowspan="6" | The format of a single claim. The available parameters are as follows. {| class="wikitable" |- ! Parameter ! Description |- | <code>%p</code> | The claim's property value applied by the <code>property</code>/<code>properties</code> command. |- | <code>%q1</code>, <code>%q2</code>, <code>%q3</code>, ... | The claim's qualifier value or list of qualifier values applied by the corresponding <code>qualifier</code>/<code>qualifiers</code> command. |- | <code>%q</code> | The collection of the qualifier values applied by each <code>qualifier</code>/<code>qualifiers</code> command (i.e. <code>%q1</code> + <code>%q2</code> + <code>%q3</code> + ...). If only one <code>qualifier</code>/<code>qualifiers</code> command was given, then this parameter is equivalent to <code>%q1</code>. |- | <code>%r</code> | The claim's reference value or list of reference values applied by the <code>reference</code>/<code>references</code> command. |- | <code>%a</code> | The entity's alias applied by the <code>alias</code>/<code>aliases</code> command. |- | <code>%b</code> | The entity's page badge applied by the <code>badge</code>/<code>badges</code> command. |- | <code>%s</code> | The movable separator placeholder. This is a special parameter that is not applied by a command, but instead is filled automatically between each pair of claims, aliases or badges (if a list of claims, aliases or badges is returned). This is particularly handy in case a claim's reference is returned as well, since it allows the reference to be placed after the punctuation mark as prescribed by [[Wikipedia:Manual of Style#Punctuation and footnotes|Wikipedia's manual of style]]. The default value is a comma (<code>,</code>) and can be overridden with the <code>sep%s</code> flag (see below). |} Optional parameters can be given by encapsulating them between square brackets: <code>[...]</code>. All content between the square brackets is only displayed if a value for each optional parameter that has been defined between the same brackets has been found. Optional content can also be nested. To use two opening square brackets that directly follow each other (i.e. <code>{{!((}}</code>), use <code>{{tl|!((}}</code>. At least one parameter must be given that is not optional, while the <code>%s</code> parameter must always be defined as optional. To get a literal <code>[</code>, <code>]</code>, <code>%</code> or <code>\</code>, escape the character by placing a backslash <code>\</code> directly in front of it (e.g. <code>\%</code>). See also the description directly above this table for more. |- | <code>%q[%s][%r]</code> | if the <code>property</code>/<code>properties</code> command '''was not''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was''' given |- | <code>%r</code> | if '''only''' the <code>reference</code>/<code>references</code> command was given |- | <syntaxhighlight lang="wikitext">%p[ <span style="font-size:85\%">(%q)</span>][%s][%r]</syntaxhighlight> | if the <code>property</code>/<code>properties</code> command '''was''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was''' given |- | <code>%a[%s]</code> | if the <code>alias</code>/<code>aliases</code> command was given |- | <code>%b[%s]</code> | if the <code>badge</code>/<code>badges</code> command was given |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep=</code> | <code>{{dfn|_|title=space}}</code> | <span style="color:#777;">''default''</span> | rowspan="2" | The fixed separator between each pair of claims, aliases or badges. |- | {{dfn|<code>{{0| }}</code>|title=empty}} | if '''only''' the <code>reference</code>/<code>references</code> command was given '''without''' the <code>raw</code> flag |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep%s=</code> | <code>,</code> | <span style="color:#777;">''default''</span> | rowspan="2" | The movable separator between each pair of claims, aliases or badges. This will be the value of the <code>%s</code> parameter applied to all claims, aliases or badges, except for the last in the list (which can be set with the <code>punc</code> flag). |- | <code>;</code> | if the <code>property</code>/<code>properties</code> command '''was not''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was''' given |- | colspan="4" | |- ! style="text-align:right;" | <code>sep%q1=</code>, <code>sep%q2=</code>, <code>sep%q3=</code>, ... | <code>{{dfn|,_|title=comma space}}</code> | <span style="color:#777;">''default''</span> | The separator between each pair of qualifiers of a single claim. These are the value separators for the <code>%q1</code>, <code>%q2</code>, <code>%q3</code>, ... parameters. If only one <code>qualifier</code>/<code>qualifiers</code> command was given, then the <code>sep%q1</code> flag is equivalent to <code>sep%q</code>. |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep%q=</code> | <code>{{dfn|,_|title=comma space}}</code> | if '''exactly one''' <code>qualifier</code>/<code>qualifiers</code> command was given | rowspan="2" | The separator between each set of qualifiers of a single claim. This is the value separator for the <code>%q</code> parameter. If only one <code>qualifier</code>/<code>qualifiers</code> command was given, then this flag is equivalent to <code>sep%q1</code>. |- | <code>{{dfn|{{;}}_|title=semicolon space}}</code> | if '''more than one''' <code>qualifier</code>/<code>qualifiers</code> command was given |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep%r=</code> | {{dfn|<code>{{0| }}</code>|title=empty}} | <span style="color:#777;">''default''</span> | rowspan="2" | The separator between each pair of references of a single claim. This is the value separator for the <code>%r</code> parameter. |- | <code>{{dfn|_|title=space}}</code> | if the <code>raw</code> flag '''was''' given for the <code>reference</code>/<code>references</code> command |- | colspan="4" | |- ! style="text-align:right;" | <code>punc=</code> | {{dfn|<code>{{0| }}</code>|title=empty}} | <span style="color:#777;">''default''</span> | A punctuation mark placed at the end of the output. This will be placed on the <code>%s</code> parameter applied to the last claim (or alias or badge) in the list. This allows the last claim's references to be placed after the punctuation mark when the output is used as part of a sentence. |}
摘要:
请注意,所有对代码酷的贡献均被视为依照知识共享署名-非商业性使用-相同方式共享发表(详情请见
代码酷:著作权
)。如果您不希望您的文字作品被随意编辑和分发传播,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)