Template:Imbox/doc:修订间差异
外观
删除的内容 添加的内容
将 Mbox templates 移到 doc 最顶部(跟随 mworg 做法) |
从 zhwiki 适配完整文档,追加 Uses TemplateStyles 声明 |
||
| 第2行: | 第2行: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
{{Uses Lua|Module:Message box}} |
{{Uses Lua|Module:Message box}} |
||
{{Uses TemplateStyles|Module:Message box/imbox.css}} |
|||
'''{{tlx|Imbox}}'''(Image message |
'''{{tlx|Imbox}}'''(Image message box,图片信息框)用于文件描述页的消息框模板。该模板与 {{tlx|Ambox}} 几乎相同,使用同样的参数。 |
||
== 常用参数 == |
== 常用参数 == |
||
| 第11行: | 第12行: | ||
| <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>license</code> / <code>featured</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>license</code> / <code>featured</code> |
||
|- |
|- |
||
| <code>image</code> || 自定义图标 |
| <code>image</code> || 自定义图标(<code>none</code> 则不显示图片) |
||
|- |
|- |
||
| <code> |
| <code>imageright</code> || 右侧图片 |
||
|- |
|||
| <code>style</code> || 整个信息框的 CSS 样式 |
|||
|- |
|||
| <code>textstyle</code> || 文字单元格的 CSS 样式 |
|||
|- |
|||
| <code>text</code> || 消息正文 |
|||
|} |
|} |
||
== |
== type 类型 == |
||
以下示例使用不同的 type 参数及对应的预设图片: |
|||
| ⚫ | |||
| ⚫ | |||
{{Imbox|type=speedy|text=type=<u>speedy</u> 快速删除}} |
|||
{{Imbox|type=delete|text=type=<u>delete</u> 删除}} |
|||
{{Imbox|type=content|text=type=<u>content</u> 较严重的警告和问题}} |
|||
{{Imbox|type=style|text=type=<u>style</u> 较轻的警告和问题}} |
|||
{{Imbox|type=notice|text=type=<u>notice</u> 注意及各类信息}} |
|||
{{Imbox|type=move|text=type=<u>move</u> 移动/重命名信息和提议}} |
|||
{{Imbox|type=protection|text=type=<u>protection</u> 页面保护}} |
|||
| ⚫ | |||
| ⚫ | |||
== 特殊设定 == |
|||
{{Imbox|text=未指定 type 和 image(默认)}} |
|||
{{Imbox|image=none|text=image=none — 不使用图片,text 占用整个信息框区域}} |
|||
== 参数说明 == |
|||
<syntaxhighlight lang="wikitext"> |
|||
{{imbox |
|||
| type = speedy / delete / content / style / notice / move / protection / license / featured |
|||
| image = none / [[File:Some image.svg|40px]] |
|||
| imageright = [[File:Some image.svg|40px]] |
|||
| style = CSS 取值 |
|||
| textstyle = CSS 取值 |
|||
| text = 消息正文 |
|||
}} |
|||
</syntaxhighlight> |
|||
== 技术细节 == |
|||
如需在 text 参数中使用特殊字符: |
|||
<syntaxhighlight lang="wikitext"> |
|||
{{imbox |
|||
| text = |
|||
等号 = 与前后大括号 { } 可以正常使用。 |
|||
但管道符 {{!}} 与两个后大括号 <nowiki>}}</nowiki> 不能直接使用。 |
|||
同时使用需加 nowiki 标记 <nowiki>|}}</nowiki>。 |
|||
}} |
|||
</syntaxhighlight> |
|||
此模板使用 CSS 类确定显示风格。内部使用 HTML 表格标记,这是元模板常见做法。 |
|||
== 参见 == |
== 参见 == |
||
* {{tlx| |
* {{tlx|Ambox}} — 条目消息框 |
||
* {{tlx|Tmbox}} — 讨论页消息框 |
|||
* {{tlx|Cmbox}} — 分类消息框 |
|||
* {{tlx|Ombox}} — 其他页面消息框 |
|||
* {{tlx|Fmbox}} — 页眉和页脚消息框 |
|||
* {{tlx|Mbox}} — 自动检测命名空间 |
|||
<includeonly> |
<includeonly> |
||
2026年6月22日 (一) 10:50的最新版本
| 此页面是Template:Imbox的文档子页面。 此页面可能包含了使用说明、分类和其他内容,这些内容不属于原始Template页面。 |
| 此模板使用Lua语言: |
| 本模板使用以下模板样式: |
{{Imbox}}(Image message box,图片信息框)用于文件描述页的消息框模板。该模板与 {{Ambox}} 几乎相同,使用同样的参数。
常用参数
| 参数 | 说明 |
|---|---|
type |
speedy / delete / content / style / notice / move / protection / license / featured
|
image |
自定义图标(none 则不显示图片)
|
imageright |
右侧图片 |
style |
整个信息框的 CSS 样式 |
textstyle |
文字单元格的 CSS 样式 |
text |
消息正文 |
type 类型
以下示例使用不同的 type 参数及对应的预设图片:
| type=speedy 快速删除 |
| type=delete 删除 |
| type=content 较严重的警告和问题 |
| type=style 较轻的警告和问题 |
| type=notice 注意及各类信息 |
| type=move 移动/重命名信息和提议 |
| type=protection 页面保护 |
| type=license 许可模板 |
| type=featured 特色图片 |
特殊设定
| 未指定 type 和 image(默认) |
| image=none — 不使用图片,text 占用整个信息框区域 |
参数说明
{{imbox
| type = speedy / delete / content / style / notice / move / protection / license / featured
| image = none / [[File:Some image.svg|40px]]
| imageright = [[File:Some image.svg|40px]]
| style = CSS 取值
| textstyle = CSS 取值
| text = 消息正文
}}
技术细节
如需在 text 参数中使用特殊字符:
{{imbox
| text =
等号 = 与前后大括号 { } 可以正常使用。
但管道符 {{!}} 与两个后大括号 <nowiki>}}</nowiki> 不能直接使用。
同时使用需加 nowiki 标记 <nowiki>|}}</nowiki>。
}}
此模板使用 CSS 类确定显示风格。内部使用 HTML 表格标记,这是元模板常见做法。
参见
{{Ambox}}— 条目消息框{{Tmbox}}— 讨论页消息框{{Cmbox}}— 分类消息框{{Ombox}}— 其他页面消息框{{Fmbox}}— 页眉和页脚消息框{{Mbox}}— 自动检测命名空间