跳转到内容

Template:Cmbox/doc:修订间差异

勤求古训,博采众方
删除的内容 添加的内容
开篇添加 Mbox templates 导航
无编辑摘要
 
(未显示1个用户的3个中间版本)
第1行: 第1行:
{{Mbox templates}}
{{Documentation subpage}}
{{Documentation subpage}}
{{Uses Lua|Module:Message box}}
{{Uses Lua|Module:Message box}}
{{Uses TemplateStyles|Module:Message box/cmbox.css}}
{{Mbox templates}}


'''{{tlx|Cmbox}}'''(Category message box)用于分类页面。以背景色区分消息级别
'''{{tlx|Cmbox}}'''(Category message box,分类信息框)是用于分类页面消息框元模板。它提供多种不同的颜色,未指定图片时使用预设图片

该模板与 {{tlx|Ambox}} 几乎相同,使用同样的参数。


== 常用参数 ==
== 常用参数 ==
第11行: 第14行:
| <code>type</code> || <code>speedy</code> / <code>delete</code> / <code>content</code> / <code>style</code> / <code>notice</code> / <code>move</code> / <code>protection</code>
| <code>type</code> || <code>speedy</code> / <code>delete</code> / <code>content</code> / <code>style</code> / <code>notice</code> / <code>move</code> / <code>protection</code>
|-
|-
| <code>image</code> || 自定义图标
| <code>image</code> || 自定义图标(<code>none</code> 则不显示图片)
|-
|-
| <code>text</code> || 消息文本
| <code>imageright</code> || 右侧图片
|-
| <code>style</code> || 整个信息框的 CSS 样式
|-
| <code>textstyle</code> || 文字单元格的 CSS 样式
|-
| <code>text</code> || 消息正文
|}
|}


== 示例 ==
== type 类型 ==
以下示例使用不同的 type 参数,不指定 image 时使用各 type 对应的预设图片。
{{Cmbox|type=notice|text=这是一个分类页提示}}

{{Cmbox|type=move|text=此分类可能被重命名。}}
{{Cmbox|type=speedy|text=type=<u>speedy</u> 快速删除}}
{{Cmbox|type=delete|text=type=<u>delete</u> 删除}}
{{Cmbox|type=content|text=type=<u>content</u> 大警告与问题}}
{{Cmbox|type=style|text=type=<u>style</u> 小警告与问题}}
{{Cmbox|type=notice|text=type=<u>notice</u> 各种提示与信息}}
{{Cmbox|type=move|text=type=<u>move</u> 移动、合并与分割}}
{{Cmbox|type=protection|text=type=<u>protection</u> 页面保护}}

== 特殊设定 ==
{{Cmbox|text=未指定 type 和 image(默认)}}
{{Cmbox|image=none|text=image=none — 不使用图片,text 占用整个信息框区域}}

== 参数说明 ==
<syntaxhighlight lang="wikitext">
{{cmbox
| 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 = 消息正文
}}
</syntaxhighlight>

== 技术细节 ==
如需在 text 参数中使用特殊字符:
<syntaxhighlight lang="wikitext">
{{cmbox
| text =
等号 = 与前后大括号 { } 可以正常使用。
但管道符 {{!}} 与两个后大括号 <nowiki>}}</nowiki> 不能直接使用。
同时使用需加 nowiki 标记 <nowiki>|}}</nowiki>。
}}
</syntaxhighlight>

此模板使用 CSS 类确定显示风格。内部使用 HTML 表格标记,这是元模板常见做法。


== 参见 ==
== 参见 ==
* {{tlx|Ambox}} — 条目消息框
{{Mbox templates}}
* {{tlx|Mbox}} — 自动检测命名空间的消息框
* {{tlx|Tmbox}} — 讨论页消息框
* {{tlx|Imbox}} — 文件页消息框
* {{tlx|Ombox}} — 其他页面消息框
* {{tlx|Fmbox}} — 页眉和页脚消息框
* {{tlx|Mbox}} — 自动检测命名空间


<includeonly>
<includeonly>

2026年6月25日 (四) 09:48的最新版本

消息框模板

{{Cmbox}}(Category message box,分类信息框)是用于分类页面的消息框元模板。它提供多种不同的颜色,未指定图片时使用预设图片。

该模板与 {{Ambox}} 几乎相同,使用同样的参数。

常用参数

参数 说明
type speedy / delete / content / style / notice / move / protection
image 自定义图标(none 则不显示图片)
imageright 右侧图片
style 整个信息框的 CSS 样式
textstyle 文字单元格的 CSS 样式
text 消息正文

type 类型

以下示例使用不同的 type 参数,不指定 image 时使用各 type 对应的预设图片。

特殊设定

参数说明

{{cmbox
| 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  = 消息正文
}}

技术细节

如需在 text 参数中使用特殊字符:

{{cmbox
| text  = 
等号 = 与前后大括号 { } 可以正常使用。
但管道符 {{!}} 与两个后大括号 <nowiki>}}</nowiki> 不能直接使用。
同时使用需加 nowiki 标记 <nowiki>|}}</nowiki>}}

此模板使用 CSS 类确定显示风格。内部使用 HTML 表格标记,这是元模板常见做法。

参见

  • {{Ambox}} — 条目消息框
  • {{Tmbox}} — 讨论页消息框
  • {{Imbox}} — 文件页消息框
  • {{Ombox}} — 其他页面消息框
  • {{Fmbox}} — 页眉和页脚消息框
  • {{Mbox}} — 自动检测命名空间