打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

目前wiki关闭了自行注册账号的功能,如需注册账号,请查阅Help:注册账号

模板:Dmbox:修订间差异

来自RIA | Wiki
Aunst留言 | 贡献
删除魔术字
Aunst留言 | 贡献
分类太多了
标签mobile edit mobile web edit advanced mobile edit
 
第26行: 第26行:
   | disambig
   | disambig
   | setindex =    <!-- Do nothing, valid "type" -->
   | setindex =    <!-- Do nothing, valid "type" -->
   | #default = <div style="text-align: center;"><p class="error" style="font-size: normal;">此消息框使用了无效的 "type={{{type|}}}" 参数, 需要修复。</p></div>[[Category:Wikipedia message box parameter needs fixing|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
   | #default = <div style="text-align: center;"><p class="error" style="font-size: normal;">此消息框使用了无效的 "type={{{type|}}}" 参数,需要修复。</p></div>[[Category:Wikipedia message box parameter needs fixing|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
}}<!--  
}}<!--  
   Magic word for disambiguation pages:
   Magic word for disambiguation pages:
第39行: 第39行:
   | disambig    <!-- disambig = default -->
   | disambig    <!-- disambig = default -->
   | #default = {{category handler
   | #default = {{category handler
     | main = [[Category:条目消歧义页面]][[Category:消歧义页面]]
     | main = [[Category:消歧义页面]]
     | template =    <!-- Don't categorize on template pages. -->
     | template =    <!-- Don't categorize on template pages. -->
     | other = [[Category:消歧义页面]]
     | other = [[Category:消歧义页面]]

2025年10月1日 (三) 10:09的最新版本

模板文档

这是 {{Dmbox}} ([D]isambiguation footer [m]essage [box]) (消歧义页脚消息框) 元模板。

其被用于构建消歧义同类索引条目消息框, 例如 {{Disambiguation}} 。

此模板的工作方式和 {{Ambox}} 相似且大部分使用了相同的参数。主要差异在于本消息框用于消歧义风格, 并只有2种 "type" 设定选项。

使用

简单使用例:

{{Dmbox 
  | text = 一些文本。
}}
{{Dmbox
  | type = setindex
  | text = 一些文本。
}}

稍复杂的例子:

{{Dmbox
  | type      = setindex
  | image     = [[File:Schooner.svg|30px|link=|alt=]] [[File:DAB list gray.png|30px|alt=消歧义图标]]
  | textstyle = color: red; font-weight: bold; font-style: normal;
  | text      = 消息文本。
}}

其他一些参数组合:

参数

所有参数列表:

{{Dmbox
  | type  = disambig / setindex
  | image = none / [[File:一些图像.svg|40px|link=|alt=]]
  | imageright = [[File:一些图像.svg|40px|link=|alt=]]
  | style     = CSS 值
  | textstyle = CSS 值
  | text  = 消息框文本。 
  | nocat = {{{nocat|}}} / true
}}
type
If no |type= parameter is given the template defaults to type disambig.
如果未指定 |type= 参数, 模板将使用默认的 disambig 类型。
disambig = 将页面添加至 Category:All disambiguation pagesCategory:All article disambiguation pages 分类中。
setindex = 将页面添加至 Category:All set index articles 分类中
nocat
true = 阻止模板分类。在测试和演示时很有用。Dmbox模板应始终转发此参数, 因为这样它们也可以选择隐藏类别。因此, 建议Dmbox模板始终添加与此类似的内容:
nocat = {{{nocat|}}}
image
[No parameter] = 如果未指定 |image= 参数, 模板会使用默认的的 disambigsetindex 图像。
一张图像 = 应是一张使用标准wikitext语法的图像。30px-50px的宽度通常大约正确, 具体取决于图像的高宽比。 (将宽度保持较小; 此模板中的图像不会在移动设备上自动缩小。) 例如:
image = [[File:Schooner.svg|30px|link=|alt=]]
none = 意味着不使用图像。
imageright
无参数 = 如果未指定 imageright 参数, 就不会在右侧显示图像。
一张图像 = 应是一张使用标准wikitext语法的图像。30px-50px的宽度通常大约正确, 具体取决于图像的高宽比。 (将宽度保持较小; 此模板中的图像不会在移动设备上自动缩小。) 例如:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Books icon]]
任何东西 = 任何你想在右侧显示的项目。
style
可选的作用于整个消息框的CSS值。不带引号 " " 但需要有结束分号 ; 。例如:
|style=margin-bottom: 0.2em;
textstyle
作用于文本区域的CSS值。不带引号 " " 但需要有结束分号 ; 。例如:
|style=text-align: center;
text
消息框的主体文本, 消息框文本默认为 斜体 , 因此不需要再次设置。

技术细节

如果需要在text参数中使用特殊字符, 则需要像这样对它们进行转义:

{{Dmbox
  | text  = <div>
等号 (=) 和开始结束大括号 ({ }) 会正常显示。
但是需要这样表示管道符 {{!}} 和两个连续结束大括号<nowiki>}}</nowiki>. 
这样表示连续管道符和结束大括号: <nowiki>|}}</nowiki>.
</div>
}}

对于更多技术细节, 可参见此模板的原讨论页。因为此模板的工作方式与 {{Ambox}}, {{Tmbox}}, {{Imbox}}, {{Cmbox}} 和 {{Ombox}} 相似, 所以这些模板的讨论页和相关页面可能也有更多细节。

脚注