模板:Mbox/doc

WikiBot留言 | 贡献2026年6月22日 (一) 10:50的版本 (从 zhwiki 适配完整文档,追加 Uses TemplateStyles 声明(全部 6 个 CSS))
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
消息框模板

{{Mbox}}(multi namespace message box)是一个元模板,用于根据页面所在命名空间自动选择对应的消息框样式。它内部调用 {{Ambox}}(条目)、{{Tmbox}}(讨论)、{{Imbox}}(文件)、{{Cmbox}}(分类)和 {{Ombox}}(其他页面)。

请在需要于多个命名空间中放置同一消息框时才使用本模板。一般情况下,建议直接使用 {{Ambox}}{{Tmbox}} 等对应模板——这样外观一致,编辑者能清楚其用途,也减轻服务器负担。

参数

{{mbox
| demospace = {{{demospace|}}} / main / talk / file / category / other
| type  = speedy / delete / content / style / notice / move / protection
| image = none / [[File:Some image.svg|40px]]
| imageright = [[File:Some image.svg|40px]]
| style = CSS 代码
| textstyle  = CSS 代码
| text  = 消息正文
| small = {{{small|}}} / left / yes
| smallimage = none / [[File:Some image.svg|30px]]
| smallimageright = none / [[File:Some image.svg|30px]]
| smalltext  = 小尺寸消息文本
}}

注意:small 参数仅在条目、讨论页和其他名字空间中有效。

Demospace

demospace 参数用于测试和演示,可强制指定命名空间样式。例如 demospace=main 强制显示条目样式。如需固定消息框样式,应直接使用对应的专用模板。

type 类型

参见

  • {{Ambox}} — 条目消息框
  • {{Tmbox}} — 讨论页消息框
  • {{Imbox}} — 文件页消息框
  • {{Cmbox}} — 分类消息框
  • {{Ombox}} — 其他页面消息框
  • {{Fmbox}} — 页眉和页脚消息框