模板:Title year
跳转到导航
跳转到搜索
File:Test Template Info-Icon - Version (2).svg 模板文档[查看] [编辑] [历史] [清除缓存]
| File:Lua-Logo.svg | 此模板使用Lua语言: |
| 警告 | 此模板被引用于约40,000个页面。 为了避免造成大规模的影响,所有对此模板的编辑应先于沙盒、测试样例或您的沙盒上测试。 测试后无误的版本可以一次性地加入此模板中,但是修改前请务必于讨论页发起讨论。 模板引用数量会自动更新。 |
用法[编辑]
{{Title year}}
或
{{Title year|match|nomatch|page=}}
或
{{Title year|match=|nomatch=|page=}}
模板数据[编辑]
<templatedata> { "params": { "1": { "aliases": [ "match" ], "label": "匹配实例", "description": "如果找到多个3位或4位数字,此参数指定返回第几个匹配项,其中第一个匹配项对应 match=1。如果指定负数,则从最后一个匹配项开始倒数返回。因此 match=-1 等同于请求最后一个匹配项。默认为1。", "type": "number", "default": "1" }, "2": { "aliases": [ "nomatch" ], "label": "无匹配文本", "description": "如果未找到3位或4位数字的年份,则输出“nomatch”值。默认为空白。", "type": "string" }, "page": { "label": "覆盖页面标题", "description": "指定要使用的页面标题,而非当前页面标题。如果留空,模板将使用当前页面的标题。", "type": "wiki-page-name", "default": "Title year" } }, "description": "从当前页面标题中提取一个3位或4位数字的年份。所有参数均为可选。" } </templatedata>