模板:Tmbox/doc
出自Full Circle 中文项目主页
|
|
这是一篇从英文翻译成中文的翻译文章 若您愿意参与本文的简体中文翻译工作,或者认为此條目的翻译需要修订或进一步增补,请勇于更新页面,作出您的贡献。如果您不知道如何开始,请参看编辑指南。(为避免翻译冲突,请务必先参看本页面讨论页上的翻译状态) 如果发生编辑冲突,请将您的翻译先保存在本机,稍后查看变更之处再更新。 |
目录 |
文章第一部分
模板:Mbox templates This is the 模板:Tl or talk page message box meta-template.
信息框模版:模板:Tl 是讨论页面信息框元模版 .
It is used to build message box templates for talk pages, such as 模板:Tl etc. It offers several different colours,uses
default images if no image parameter is given and it has some other features.
通常讨论页面中建有信息框模版, 如:模板:Tl等等 . 这些模版有多种不同的颜色 . 如果使用者没有给出图像参数时会显示默认图片. 当然还包括其他一些特性.
This template should normally not be used for WikiProject banners. They have special needs and thus have their own meta-templates.
See the "See also" section below for links.
此类模版通常情况下不用做维基百科条目. 由于有特殊的要求因此它们都有独立的元模版 . 请参阅下面"参见"部分的链接
This template works similarly to 模板:Tl and uses the same parameters.
这些模版与模板:Tl模版一样 ,都使用相同的参数.
We are deploying!
正在发布之中 !
After discussions on the talk page of this template and announcing it at several places for some time we are
now deploying this template. Feel free to convert any message boxes used on talk pages to use this meta-template. If you find any
tricky cases then list them on the talk page of this template and you'll get help.
关于此类模版已经在talk page上讨论过, 并且在许多地方已经声明过一段时间了 . 因此我们决定现在发布这种模
版. 如果您在将讨论页上的那些消息框换成带元模版的时 , 遇到任何困难请勿需烦恼. 您只需将这些困难一一列在讨论页上, 随后应会得到满意
的答复
When this template is used to build talk page message boxes those boxes should contain explanatory texts just like before. (The same
texts as before or new improved texts.) If there are more specific images in the boxes or you know a better image, then use them
instead of the default images shown here.
用于创建讨论页消息框的模版应该含有一些说明性的文字,比如:未更改的(未更改的 或 新插入的) , 如果您有一些特别的或是更好的用在消息
框里的图片, 那请您使用他们而非那些默认的图片
Suggested style standard
建议使用的样式标准
The types of talkpage messageboxes follow the same naming convention as the boxes for all other namespaces, but the type of any particular talkpage messagebox may not be as obvious as in other namespaces. When deciding on the type to use for a talkpage messagebox, please consider the following guidelines:
虽然讨论页消息框样式都遵循与对话框命名空间一样的命名习惯 ,但专用讨论页对话框命名不能明显的出现在其他命名空间之中. 当要为一个讨论页消息框确定样式时, 请参考下列向导:
- speedy should only be used for speedy deletion templates.
- speedy 样式应仅限用于speedy deletion templates-->
- delete should only be used for templates relating to ongoing deletion discussions. Please do not use this type just to get a red border for a messagebox.
- delete样式应仅限用于那些即将被删除的模版上的讨论. 请最好不要用使用这种类型, 而是将该消息框的边框变成红色.
- content and style should be used for warnings and alerts. Use content (which has an orange border) for more important and immediate alerts, and style (yellow border) for less important warnings. Messageboxes of these types should ideally be transitory: they should not be expected to remain on a talkpage indefinitely.
- conten 和style 类型可以起到警告或警示的作用. 使用content样式 (橘色边框) 可以指示一些重要的或迫切的内容 ,而style样式(黄色边框) 用于一些次要的内容 .这两种样式的消息框被认为是临时样式: 不会一直存在于讨论页之中.
- move and protection should only be used for messageboxes relating to moves and merges, and page protection, respectively.
- move和protection样式分别应仅限于指示移动或合并的消息框, 以及受保护页面的消息框
- The notice type should be used for the majority of talkpage messageboxes; those that are intended to convey or summarise information. If a talkpage messagebox does not obviously fit into one of the other types, it is probably a notice type.
- notice样式可以用于大多数的讨论页消息框 ; 以及那些转述或总结的内容. 如果没有明显合适的样式可以选择时, 该类型应该是合适的了
文章第二部分
用法
简单用法举例:
{{tmbox | text = Some text.}}
|
|
Some text. |
复杂用法举例:
{{tmbox
| type = style
| image = [[Image:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
| text = The message body text.
}}
| 40px | The message body text. |
讨论页面消息框的类型
下面的例子使用不同的 type 参数,但是没有使用图片参数,所以每种类型使用默认的图片.
|
|
type=speedy – Speedy deletion templates. |
|
|
type=delete – Deletion templates. |
|
|
type=content – Major warnings and problems. |
| 40x40px | type=style – Minor warnings and problems. |
|
|
type=notice – Notices and messages of any kind, both permanent and temporary. |
|
|
type=move – Merge, split, rename and transwiki messages and proposals. |
|
|
type=protection – Protection templates. |
特殊用法
一些其他参数的结合.
|
|
No type and no image given (default) |
| No type and image=none – No image is used and the text uses the whole message box area. |
| 42px | image = [[Image:Gnome globe current event.svg|42px]] imageright = [[Image:Nuvola apps bookcase.svg|40px]] |
40px |
文章第三部分
Parameters
参数
List of all parameters:
参数列表:
{{tmbox
| type = speedy / delete / content / style / notice / move / protection
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| style = CSS values
| textstyle = CSS values
| text = The message body text.
| small = {{{small|}}} / yes
| smallimage = none / [[Image:Some image.svg|30px]]
| smallimageright = none / [[Image:Some image.svg|30px]]
| smalltext = A shorter message body text.
}}
type
- If no type parameter is given the template defaults to type notice. That means it gets a gray border.
- 如果没有给出type参数,模板缺省值类型为notice。这意味着它的边框为灰色。
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
image = [[Image:Crystal package settings.png|40px]]
- none = Means that no image is used.
- No parameter = 如果没给出image参数,模板使用一个默认的图像。并且这个默认图像的使用依赖type参数。
- An image = 应该为一个符合wiki惯用表示的图像。据图像的高宽比而定40px -50px的宽度通常是合适的。(但对话框能处理任何大小的图像。)例如:
image = [[Image:Crystal package settings.png|40px]]
- none = 表示没有图像被使用。
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
imageright = [[Image:Nuvola apps bookcase.png|40px]]
- Anything = Any other object that you want to show on the right side.
- No parameter = 如果没有给出imageright参数,则没有图像在右侧显示。
- An image = 应该为一个符合wiki惯用表示的图像。据图像的高宽比而定40px -50px的宽度通常是合适的。(但对话框能处理任何大小的图像。)例如:
imageright = [[Image:Nuvola apps bookcase.png|40px]]
- Anything = 你想在右侧显示的任何其他对象。
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "but with the ending semicolons;. For example:style = margin-bottom: 0.5em;
- 可选的 CSS 值用于整个对话框表。没有引号
" "但使用结尾分号;。例如:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
- 可选的 CSS 值用于正文单元。例如:
textstyle = text-align: center;
text
- The message body text.
- 消息体正文。
The small parameters
小参数
|
|
small = yes |
| 30x30px | type = style small = yes |
small
- yes = Makes it a smaller right floating message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=yes". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
- yes = 显示一个更小的右侧浮动对话框。这也使得缺省的图像更小。注意只有当"small=yes"时,数据才能反应到smallimage、smallimageright和smalltext参数。令你的模板知道你在使用小参数,你可以使用这段代码:
small = {{{small|}}}
| 30px | small = yes image = [[Image:Nuvola apps bookcase.png|40px]] smallimage = [[Image:Nuvola apps bookcase.png|30px]] |
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 30px width is usually about right. For example:
smallimage = [[Image:Crystal package settings.png|30px]]
- none = Means that no image is used. This overrides any image fed to image, when "small=yes".
- No parameter = 如果没有给出smallimage参数,则模板退而使用image参数。如果image参数也为空,则使用小缺省图像代替。
- An image = 应该为一个符合wiki惯用表示的图像。宽度为30px通常是合适的。例如:
smallimage = [[Image:Crystal package settings.png|30px]]
- none = 表示没有图像被使用。当"small=yes"时,这将覆盖任何反应在image参数上的图像。
|
|
small = yes imageright = [[Image:Nuvola apps bookcase.png|40px]] |
40px |
|
|
small = yes imageright = [[Image:Nuvola apps bookcase.png|40px]] smallimageright = none |
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 30px width is usually about right. For example:
smallimageright = [[Image:Nuvola apps bookcase.png|30px]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=yes".
- No parameter = 如果没有给出smallimageright参数,则模板退而使用imageright参数。如果imageright参数也为空,则没有图像在右侧显示。
- An image = 应该为一个符合wiki惯用表示的图像。宽度为30px通常是合适的。例如:
smallimageright = [[Image:Nuvola apps bookcase.png|30px]]
- Anything = 你想在右侧显示的任何其他对象。
- none = 表示没有图像在右侧被使用。当"small=yes"时,这将覆盖任何反应在imageright上的图像。
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
- 一个简短版本的消息体正文。如果没有给出smalltext参数,则模板退而使用text参数。
文章第四部分
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{tmbox
| text = <div>
Equal sign = and a start and end brace { } work fine as they are.
But here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>.
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}
|
|
Equal sign = and a start and end brace { } work fine as they are. But here is a pipe 模板:! and two end braces }}. And now a pipe and end braces |}}. |
This template uses the tmbox CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls 模板:Tl which holds most of the code for 模板:Tl, while 模板:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.
For more technical details see the talk page. Since this template works almost exactly like 模板:Tl, 模板:Tl, 模板:Tl and 模板:Tl their talk pages and related pages might also contain more details.