Template:Tmbox/doc:修订间差异
创建页面,内容为“<noinclude>{{documentation subpage}}</noinclude> <!-- 在本行下编辑模板说明 --> {{mbox templates}} 这个模板为'''讨论页消息提示'''元模板。 这个模板被用来构建讨论页消息提示框,如{{tl|central}}。 它提供了几种不同的颜色。如果没有给出图像参数,则使用默认的图像,而且它还有其他一些功能。 这个模板通常不应该被用于WikiProject横幅。他们有特殊的需求,因此有…” |
小无编辑摘要 |
||
| (未显示同一用户的1个中间版本) | |||
| 第5行: | 第5行: | ||
这个模板被用来构建讨论页消息提示框,如{{tl|central}}。 它提供了几种不同的颜色。如果没有给出图像参数,则使用默认的图像,而且它还有其他一些功能。 | 这个模板被用来构建讨论页消息提示框,如{{tl|central}}。 它提供了几种不同的颜色。如果没有给出图像参数,则使用默认的图像,而且它还有其他一些功能。 | ||
该模板与{{tl|ambox}}模板工作原理相类似,并使用相同的参数。 | 该模板与{{tl|ambox}}模板工作原理相类似,并使用相同的参数。 | ||
当使用这个模板来构建讨论页消息提示框时,这些框应该像以前一样包含说明性文字。(和以前一样的文本或新的改进文本)。如果框中有更具体的图片,或者你知道的更好的图片,那么就用它们来代替这里显示的默认图片。 | 当使用这个模板来构建讨论页消息提示框时,这些框应该像以前一样包含说明性文字。(和以前一样的文本或新的改进文本)。如果框中有更具体的图片,或者你知道的更好的图片,那么就用它们来代替这里显示的默认图片。 | ||
| 第38行: | 第33行: | ||
| image = [[File:Emblem-question-yellow.svg|40px]] | | image = [[File:Emblem-question-yellow.svg|40px]] | ||
| style = width: 400px; | | style = width: 400px; | ||
| textstyle = color: red; font-weight: bold; font-style: italic; | | textstyle = color: red; font-weight: bold;font-style: italic; | ||
| text = | | text = 消息正文文本。 | ||
}} | }} | ||
</pre> | </pre> | ||
| 第47行: | 第42行: | ||
| image = [[File:Emblem-question-yellow.svg|40px]] | | image = [[File:Emblem-question-yellow.svg|40px]] | ||
| style = width: 400px; | | style = width: 400px; | ||
| textstyle = color: red; font-weight: bold; font-style: italic; | | textstyle = color: red; font-weight: bold;font-style: italic; | ||
| text | | text = 消息正文文本。 | ||
}} | }} | ||
| 第73行: | 第68行: | ||
{{tmbox | {{tmbox | ||
| type = notice | | type = notice | ||
| text = type=<u>notice</u> – | | text = type=<u>notice</u> – 任何类型的通知和消息,包括永久性和临时性的。 | ||
}} | }} | ||
{{tmbox | {{tmbox | ||
| type = move | | type = move | ||
| text = type=<u>move</u> – | | text = type=<u>move</u> – 合并、拆分、重命名和转换Wiki消息和建议。 | ||
}} | }} | ||
{{tmbox | {{tmbox | ||
| type = protection | | type = protection | ||
| text = type=<u>protection</u> – | | text = type=<u>protection</u> – 保护模板。 | ||
}} | }} | ||
| 第89行: | 第84行: | ||
*type、image参数留空:默认样式 | *type、image参数留空:默认样式 | ||
{{tmbox | {{tmbox | ||
| text = | | text = 未提供类型和图像 ('''default''') | ||
}} | }} | ||
*image参数指定为none(image=none):纯信息 | *image参数指定为none(image=none):纯信息 | ||
{{tmbox | {{tmbox | ||
| image = none | | image = none | ||
| text = No type and '''image=none''' – | | text = No type and '''image=none''' – 未使用图像,“text”使用整个消息框区域。 | ||
}} | }} | ||
*实现左右两张图片(image = <nowiki>[[File:Gnome globe current event.svg|42px]]</nowiki> | imageright = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki>):指 | *实现左右两张图片(image = <nowiki>[[File:Gnome globe current event.svg|42px]]</nowiki> | imageright = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki>):指定'''imageright'''参数 | ||
{{tmbox | {{tmbox | ||
| image = [[File:Gnome globe current event.svg|42px]] | | image = [[File:Gnome globe current event.svg|42px]] | ||
| 第112行: | 第107行: | ||
| image = none / [[File:Some image.svg|40px]] | | image = none / [[File:Some image.svg|40px]] | ||
| imageright = [[File:Some image.svg|40px]] | | imageright = [[File:Some image.svg|40px]] | ||
| style = CSS | | style = CSS值 | ||
| textstyle = CSS | | textstyle = CSS值 | ||
| text = | | text = 消息正文文本。 | ||
| small = {{{small|}}} / yes | | small = {{{small|}}} / yes | ||
| smallimage = none / [[File:Some image.svg|30px]] | | smallimage = none / [[File:Some image.svg|30px]] | ||
| smallimageright = none / [[File:Some image.svg|30px]] | | smallimageright = none / [[File:Some image.svg|30px]] | ||
| smalltext = | | smalltext = 较短的信息正文文本。 | ||
}} | }} | ||
</pre> | </pre> | ||
'''type''' | '''type''' | ||
: | :如果未指定 '''type''' 参数,则模板默认为类型 '''notice'''。这意味着它有一个灰色的边界。 | ||
'''image''' | '''image''' | ||
:'''No parameter''' = | :'''No parameter''' = 如果未指定'''image'''参数,模板将使用默认图像。它使用的默认图像取决于'''type'''参数。 | ||
:'''An image''' = | :'''An image''' = 应该是具有通常维基符号的图像。40px - 50px 宽度通常大约正确,具体取决于图像高宽比。(但消息框可以处理任何大小的图像。例如: | ||
::<code><nowiki>image = [[File:Crystal package settings.png|40px]]</nowiki></code> | ::<code><nowiki>image = [[File:Crystal package settings.png|40px]]</nowiki></code> | ||
:'''none''' = | :'''none''' =表示未使用图像。 | ||
'''imageright''' | '''imageright''' | ||
:'''No parameter''' = | :'''No parameter''' = 如果未提供 '''imageright''' 参数,则右侧不会显示图像。 | ||
:'''An image''' = | :'''An image''' = 应该是具有通常wiki符号的图像。40px-50px 宽度通常大约正确,具体取决于图像高宽比。(但消息框可以处理任何大小的图像。例如: | ||
::<code><nowiki>imageright = [[File:Nuvola apps bookcase.svg|40px]]</nowiki></code> | ::<code><nowiki>imageright = [[File:Nuvola apps bookcase.svg|40px]]</nowiki></code> | ||
:'''Anything''' = | :'''Anything''' = 要在右侧显示的任何其他对象。 | ||
'''style''' | '''style''' | ||
: | :整个消息框表使用的可选CSS值。没有引号<code>""</code>,但结尾分号<code> | ||
</代码>。例如: | |||
::<code>style = margin-bottom: 0.5em;</code> | ::<code>style = margin-bottom: 0.5em;</code> | ||
'''textstyle''' | '''textstyle''' | ||
: | :文本单元格使用的可选CSS值。例如: | ||
::<code>textstyle = text-align: center;</code> | ::<code>textstyle = text-align: center;</code> | ||
'''text''' | '''text''' | ||
: | :消息正文文本。 | ||
==== | ==== small 参数 ==== | ||
{{tmbox | {{tmbox | ||
| 第160行: | 第156行: | ||
}} | }} | ||
'''small''' | '''small''' | ||
:'''yes''' = | :'''yes''' = 使其成为较小的右浮动消息框。这也会使默认图像变小。请注意,仅当 '''small=yes''' 时,才会使用输入到 '''smallimage'''、'''smallimageright'''和'''smalltext''' 参数的任何数据。为了使模板也能理解小参数,可以使用以下代码: | ||
::<code><nowiki>small = {{{small|}}}</nowiki></code> | ::<code><nowiki>small = {{{small|}}}</nowiki></code> | ||
| 第171行: | 第167行: | ||
}} | }} | ||
'''smallimage''' | '''smallimage''' | ||
:'''No parameter''' = | :'''No parameter''' = 如果未给定 '''smallimage''' 参数,则此模板将回退为使用 '''image'''。如 '''image''' 参数也为空,则使用小的默认图像。 | ||
:'''An image''' = | :'''An image''' = 应该是一个带有常用wiki符号的图像。30px的宽度通常是正确的。例如: | ||
::<code><nowiki>smallimage = [[File:Crystal package settings.png|30px]]</nowiki></code> | ::<code><nowiki>smallimage = [[File:Crystal package settings.png|30px]]</nowiki></code> | ||
:'''none''' = | :'''none''' = 表示未使用图像。当 '''small=yes''' 时,这将覆盖馈送到 '''image''' 的任何图像。 | ||
{{tmbox | {{tmbox | ||
| small = yes | | small = yes | ||
| 第191行: | 第186行: | ||
'''smallimageright''' | '''smallimageright''' | ||
:'''No parameter''' = | :'''No parameter''' = 如果未给定 '''smallimageright''' 参数,则此模板将回退为使用 '''smallimage''' 参数。如果 '''imageright''' 参数也为空,则右侧不会显示图像。 | ||
:'''An image''' = | :'''An image''' = 应该是一个带有常用wiki符号的图像。30px的宽度通常是正确的。例如: | ||
::<code><nowiki>smallimageright = [[File:Nuvola apps bookcase.svg|30px]]</nowiki></code> | ::<code><nowiki>smallimageright = [[File:Nuvola apps bookcase.svg|30px]]</nowiki></code> | ||
:'''Anything''' = | :'''Anything''' = 要在右侧显示的任何其他对象。 | ||
:'''none''' = | :'''none''' = 表示未使用右侧图像。当 '''small=yes''' 时,这将覆盖馈送到 '''imageright''' 的任何图像。 | ||
'''smalltext''' | '''smalltext''' | ||
: | :消息正文文本的较短版本。如果未给定 '''smalltext''' 参数,则此模板将回退为使用 '''text'''。 | ||
=== 技术细节 === | |||
如果你需要在text参数中使用一些特殊字符的话,那么就需要像这样将它们换码: | |||
<pre> | <pre> | ||
{{tmbox | {{tmbox | ||
| text = <div> | | text = <div> | ||
等号 = 与前后大括号{ }可以正常地使用。 | |||
但是管道符{{!}}与两个连着的后大括号<nowiki>}}</nowiki>则不能直接使用。 | |||
一起用同样要带nowiki标记<nowiki>|}}</nowiki>。 | |||
</div> | </div> | ||
}} | }} | ||
| 第216行: | 第210行: | ||
{{tmbox | {{tmbox | ||
| text = <div> | | text = <div> | ||
等号 = 与前后大括号{ }可以正常地使用。 | |||
但是管道符{{!}}与两个连着的后大括号<nowiki>}}</nowiki>则不能直接使用。 | |||
一起用同样要带nowiki标记<nowiki>|}}</nowiki>。 | |||
</div> | </div> | ||
}} | }} | ||
该模板使用[[mediawiki:Common.css]]中的tmbox CSS类来实现其大部分外观,因此它是完全可剥皮的。 | |||
由于此模板的工作方式几乎与{{tl|ambox}}、{{tl|imbox}}、{{tl|cmbox}}和{{tl|ombox}}完全相同,因此他们的讨论页面和相关页面也可能包含更多详细信息。 | |||
== 参看 == | == 参看 == | ||
{{Mbox templates see also}} | {{Mbox templates see also}} | ||
wiki专题横幅: | |||
* {{tl|WikiProjectBannerShell}} 和 {{tl|WPBannerMeta}} – 用于折叠、包装和创建wiki专题横幅的系统。 | |||
* {{tl|WikiProjectBanners}} – 另一个用于折叠wiki专题横幅的系统。 | |||
<includeonly> | <includeonly> | ||
<!-- 本行下加入模板的分類 --> | <!-- 本行下加入模板的分類 --> | ||
2022年11月26日 (六) 22:01的最新版本
| 此页面是Template:Tmbox的Templatedocumentation。 此页面可能包含了模板的使用说明、分类和其他内容。 |
| zh-cn:信息; zh-tw: 訊息框元模板 | |
|---|---|
| 模板 | 背景 |
| {{Ambox}} | 条目 |
| {{Cmbox}} | 分类 |
| {{Imbox}} | 图片 |
| {{Tmbox}} | 讨论 |
| {{Fmbox}} | 页脚/标题 |
| {{Ombox}} | 其他页面 |
| {{Mbox}} | 自动侦测 |
| 消歧义 | |
这个模板为讨论页消息提示元模板。
这个模板被用来构建讨论页消息提示框,如{{central}}。 它提供了几种不同的颜色。如果没有给出图像参数,则使用默认的图像,而且它还有其他一些功能。
该模板与{{ambox}}模板工作原理相类似,并使用相同的参数。
当使用这个模板来构建讨论页消息提示框时,这些框应该像以前一样包含说明性文字。(和以前一样的文本或新的改进文本)。如果框中有更具体的图片,或者你知道的更好的图片,那么就用它们来代替这里显示的默认图片。
建议的样式标准
讨论页信息框的类型与所有其他命名空间的信息框遵循相同的命名惯例,但任何特定讨论页信息框的类型可能不像其他命名空间那样明显。 在决定通话页消息框的类型时,请考虑以下准则:
- speedy只应该被用于快速删除模板。
- delete 只应该被用于与正在进行的删除讨论相关的模板。不要为了给自己消息框加个好看的红边框使用这个参数。
- content和style只应该被用于警告和提醒。content有橙色边框,用于更加重要、紧急的警告。style有黄色边框,用于较低重要度警告。这两种类型的信息框只应用于临时用途,不宜在讨论页上长期留存。
- move和protection只应该被用于与移动、合并、页面保护相关的消息框。
- notice参数应该被用于大部分讨论页信息框,以提醒,告知相关信息。这个参数几乎可以通用。
用法
一些用法:
{{tmbox | text = 示例文本}}
| 示例文本 |
复杂用法:
{{tmbox
| type = style
| image = [[File:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold;font-style: italic;
| text = 消息正文文本。
}}
| 消息正文文本。 |
讨论页消息框样式
以下示例为指定不同type参数但不指定图片参数输出的默认图像
| type=speedy——快删模板 |
| type=delete——删除模板 |
| type=content——大部分警告和提醒 |
| type=style——较小警告和问题 |
| type=notice – 任何类型的通知和消息,包括永久性和临时性的。 |
| type=move – 合并、拆分、重命名和转换Wiki消息和建议。 |
| type=protection – 保护模板。 |
更高级的操作
各种参数的混合实例:
- type、image参数留空:默认样式
| 未提供类型和图像 (default) |
- image参数指定为none(image=none):纯信息
| No type and image=none – 未使用图像,“text”使用整个消息框区域。 |
- 实现左右两张图片(image = [[File:Gnome globe current event.svg|42px]] | imageright = [[File:Nuvola apps bookcase.svg|40px]]):指定imageright参数
| image = [[File:Gnome globe current event.svg|42px]] imageright = [[File:Nuvola apps bookcase.svg|40px]] |
参数
各参数使用列表:
{{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 = 较短的信息正文文本。
}}
type
- 如果未指定 type 参数,则模板默认为类型 notice。这意味着它有一个灰色的边界。
image
- No parameter = 如果未指定image参数,模板将使用默认图像。它使用的默认图像取决于type参数。
- An image = 应该是具有通常维基符号的图像。40px - 50px 宽度通常大约正确,具体取决于图像高宽比。(但消息框可以处理任何大小的图像。例如:
image = [[File:Crystal package settings.png|40px]]
- none =表示未使用图像。
imageright
- No parameter = 如果未提供 imageright 参数,则右侧不会显示图像。
- An image = 应该是具有通常wiki符号的图像。40px-50px 宽度通常大约正确,具体取决于图像高宽比。(但消息框可以处理任何大小的图像。例如:
imageright = [[File:Nuvola apps bookcase.svg|40px]]
- Anything = 要在右侧显示的任何其他对象。
style
- 整个消息框表使用的可选CSS值。没有引号
"",但结尾分号
</代码>。例如:
style = margin-bottom: 0.5em;
textstyle
- 文本单元格使用的可选CSS值。例如:
textstyle = text-align: center;
text
- 消息正文文本。
small 参数

small = yes

type = style
small = yes
small
- yes = 使其成为较小的右浮动消息框。这也会使默认图像变小。请注意,仅当 small=yes 时,才会使用输入到 smallimage、smallimageright和smalltext 参数的任何数据。为了使模板也能理解小参数,可以使用以下代码:
small = {{{small|}}}

small = yes
image = [[File:Nuvola apps bookcase.svg|40px]]
smallimage = [[File:Nuvola apps bookcase.svg|30px]]
smallimage
- No parameter = 如果未给定 smallimage 参数,则此模板将回退为使用 image。如 image 参数也为空,则使用小的默认图像。
- An image = 应该是一个带有常用wiki符号的图像。30px的宽度通常是正确的。例如:
smallimage = [[File:Crystal package settings.png|30px]]
- none = 表示未使用图像。当 small=yes 时,这将覆盖馈送到 image 的任何图像。

small = yes
imageright = [[File:Nuvola apps bookcase.svg|40px]] 

small = yes
imageright = [[File:Nuvola apps bookcase.svg|40px]]
smallimageright = none
smallimageright
- No parameter = 如果未给定 smallimageright 参数,则此模板将回退为使用 smallimage 参数。如果 imageright 参数也为空,则右侧不会显示图像。
- An image = 应该是一个带有常用wiki符号的图像。30px的宽度通常是正确的。例如:
smallimageright = [[File:Nuvola apps bookcase.svg|30px]]
- Anything = 要在右侧显示的任何其他对象。
- none = 表示未使用右侧图像。当 small=yes 时,这将覆盖馈送到 imageright 的任何图像。
smalltext
- 消息正文文本的较短版本。如果未给定 smalltext 参数,则此模板将回退为使用 text。
技术细节
如果你需要在text参数中使用一些特殊字符的话,那么就需要像这样将它们换码:
{{tmbox
| text = <div>
等号 = 与前后大括号{ }可以正常地使用。
但是管道符{{!}}与两个连着的后大括号}}则不能直接使用。
一起用同样要带nowiki标记|}}。
</div>
}}

等号 = 与前后大括号{ }可以正常地使用。
但是管道符|与两个连着的后大括号}}则不能直接使用。
一起用同样要带nowiki标记|}}。
该模板使用mediawiki:Common.css中的tmbox CSS类来实现其大部分外观,因此它是完全可剥皮的。
由于此模板的工作方式几乎与{{ambox}}、{{imbox}}、{{cmbox}}和{{ombox}}完全相同,因此他们的讨论页面和相关页面也可能包含更多详细信息。
参看
在信息框(mbox)家族中的元模板:
有相近关系的元模板:
wiki专题横幅:
- {{WikiProjectBannerShell}} 和 {{WPBannerMeta}} – 用于折叠、包装和创建wiki专题横幅的系统。
- {{WikiProjectBanners}} – 另一个用于折叠wiki专题横幅的系统。