Template:Tmbox/doc:修订间差异

删除的内容 添加的内容
将 Mbox templates 移到 doc 最顶部(跟随 mworg 做法)
 
(未显示另一用户的1个中间版本)
第2行:
{{Documentation subpage}}
{{Uses Lua|Module:Message box}}
{{Uses TemplateStyles|Module:Message box/tmbox.css}}
 
'''{{tlx|Tmbox}}'''(Talk page 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>image</code> || 自定义图标(<code>none</code> 则不显示图片)
|-
| <code>textimageright</code> || 消息文本右侧图片
|-
| <code>smallstyle</code> || <code>yes</code>整个信息框的 CSS 或留空样式
|-
| <code>textstyle</code> || 文字单元格的 CSS 样式
|-
| <code>text</code> || 消息正文
|-
| <code>small</code> || <code>yes</code> 时显示为小型右浮框
|-
| <code>smallimage</code> || 小型模式下的左侧图片
|-
| <code>smallimageright</code> || 小型模式下的右侧图片
|-
| <code>smalltext</code> || 小型模式下的文字
|}
 
== 示例type 类型建议 ==
* <code>speedy</code> — 仅用于快速删除模板
{{Tmbox|type=notice|text=这是一个讨论页提示。}}
* <code>delete</code> — 仅用于与正在进行的删除讨论相关的模板
{{Tmbox|type=content|text=此讨论可能偏离主题。}}
* <code>content</code> — 橙色边框,用于更重要的警告(临时用途)
* <code>style</code> — 黄色边框,用于较低重要度警告(临时用途)
* <code>notice</code> — 灰色边框,用于大部分讨论页信息框(通用类型)
* <code>move</code> — 用于移动、合并、页面相关消息框
* <code>protection</code> — 用于页面保护模板
 
== type 演示 ==
{{Tmbox|type=speedy|text=type=<u>speedy</u> 快速删除}}
{{Tmbox|type=delete|text=type=<u>delete</u> 删除}}
{{Tmbox|type=content|text=type=<u>content</u> 大部分警告和提醒}}
{{Tmbox|type=style|text=type=<u>style</u> 较小警告}}
{{Tmbox|type=notice|text=这是一个讨论页提示。type=<u>notice</u> 各类通知和信息}}
{{Tmbox|type=move|text=type=<u>move</u> 合并、拆分和重命名提议}}
{{Tmbox|type=protection|text=type=<u>protection</u> 页面保护}}
 
== 小尺寸模式 ==
<syntaxhighlight lang="php">{{Tmbox|type=notice|small=yes|text=small=yes — 小型右浮消息框}}</syntaxhighlight>
{{Tmbox|type=notice|small=yes|text=small=yes — 小型讨论提示。右浮消息框}}
 
== 参数说明 ==
<syntaxhighlight lang="wikitext">
{{tmbox
| 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|}}} / yes
| smallimage = none / [[File:Some image.svg|30px]]
| smallimageright = none / [[File:Some image.svg|30px]]
| smalltext = 简短文字
}}
</syntaxhighlight>
 
== 技术细节 ==
如需在 text 参数中使用特殊字符:
<syntaxhighlight lang="wikitext">
{{tmbox
| text =
等号 = 与前后大括号 { } 可以正常使用。
但管道符 {{!}} 与两个后大括号 <nowiki>}}</nowiki> 不能直接使用。
同时使用需加 nowiki 标记 <nowiki>|}}</nowiki>。
}}
</syntaxhighlight>
 
此模板使用 tmbox CSS 类确定显示风格,可更换皮肤。
== 小尺寸 ==
{{Tmbox|type=notice|small=yes|text=小型讨论提示。}}
 
== 参见 ==
* {{tlx|Ambox}} — 条目消息框
* {{tlx|Imbox}} — 文件页消息框
* {{tlx|Cmbox}} — 分类消息框
* {{tlx|Ombox}} — 其他页面消息框
* {{tlx|Fmbox}} — 页眉和页脚消息框
* {{tlx|Mbox}} — 自动检测命名空间