编辑“︁
Template:Tmbox/doc
”︁(章节)
跳转到导航
跳转到搜索
Template:Editnotice load/content
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
== 用法 == 一些用法: <syntaxhighlight lang="wikitext"> {{tmbox | text = 示例文本}} </syntaxhighlight> {{tmbox | text = 示例文本}} 复杂用法: <syntaxhighlight lang="wikitext"> {{tmbox | type = style | image = [[File:Emblem-question-yellow.svg|40px]] | style = width: 400px; | textstyle = color: red; font-weight: bold; font-style: italic; | text = The message body text. }} </syntaxhighlight> {{tmbox | type = style | image = [[File:Emblem-question-yellow.svg|40px]] | style = width: 400px; | textstyle = color: red; font-weight: bold; font-style: italic; | text = The message body text. }} === 讨论页消息框样式 === 以下示例为指定不同'''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> – Notices and messages of any kind, both permanent and temporary. }} {{tmbox | type = move | text = type=<u>move</u> – Merge, split, rename and transwiki messages and proposals. }} {{tmbox | type = protection | text = type=<u>protection</u> – Protection templates. }} === 更高级的操作 === 各种参数的混合实例: *type、image参数留空:默认样式 {{tmbox | text = No type and no image given ('''default''') }} *image参数指定为none(image=none):纯信息 {{tmbox | image = none | text = No type and '''image=none''' – No image is used and the '''text''' uses the whole message box area. }} *实现左右两张图片(image = <nowiki>[[File:Gnome globe current event.svg|42px]]</nowiki> | imageright = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki>):指定imageright参数 {{tmbox | image = [[File:Gnome globe current event.svg|42px]] | imageright = [[File:Nuvola apps bookcase.svg|40px]] | text = image = <nowiki>[[File:Gnome globe current event.svg|42px]]</nowiki> <br> imageright = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki> }} === 参数 === 各参数使用列表: <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 values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / yes | smallimage = none / [[File:Some image.svg|30px]] | smallimageright = none / [[File:Some image.svg|30px]] | smalltext = A shorter message body text. }} </syntaxhighlight> '''type''' :If no '''type''' parameter is given the template defaults to type '''notice'''. That means it gets a gray border. '''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: ::<code><nowiki>image = [[File:Crystal package settings.png|40px]]</nowiki></code> :'''none''' = Means that no image is used. '''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: ::<code><nowiki>imageright = [[File:Nuvola apps bookcase.svg|40px]]</nowiki></code> :'''Anything''' = Any other object that you want to show on the right side. '''style''' :Optional [[Cascading Style Sheets|CSS]] values used by the entire message box table. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example: ::<code>style = margin-bottom: 0.5em;</code> '''textstyle''' :Optional [[Cascading Style Sheets|CSS]] values used by the text cell. For example: ::<code>textstyle = text-align: center;</code> '''text''' :The message body text. ==== The small parameters ==== {{tmbox | small = yes | text = small = yes }} {{tmbox | type = style | small = yes | text = type = style <br> 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: ::<code><nowiki>small = {{{small|}}}</nowiki></code> {{tmbox | small = yes | image = [[File:Nuvola apps bookcase.svg|40px]] | smallimage = [[File:Nuvola apps bookcase.svg|30px]] | text = small = yes <br> image = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki> <br> smallimage = <nowiki>[[File:Nuvola apps bookcase.svg|30px]]</nowiki> }} '''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: ::<code><nowiki>smallimage = [[File:Crystal package settings.png|30px]]</nowiki></code> :'''none''' = Means that no image is used. This overrides any image fed to '''image''', when "small=yes". {{tmbox | small = yes | imageright = [[File:Nuvola apps bookcase.svg|40px]] | text = small = yes <br> imageright = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki> }} {{tmbox | small = yes | imageright = [[File:Nuvola apps bookcase.svg|30px]] | smallimageright = none | text = small = yes <br> imageright = <nowiki>[[File:Nuvola apps bookcase.svg|40px]]</nowiki> <br> 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: ::<code><nowiki>smallimageright = [[File:Nuvola apps bookcase.svg|30px]]</nowiki></code> :'''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". '''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. === Technical details === If you need to use special characters in the text parameter then you need to escape them like this: <syntaxhighlight lang="wikitext"> {{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> }} </syntaxhighlight> {{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> }} 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|tmbox/core}} which holds most of the code for {{tl|tmbox}}, while {{tl|tmbox}} 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 [[m:Help:ParserFunctions|parser functions]] and special characters in parameters. For more technical details see the [[Template talk:Tmbox|talk page]]. Since this template works almost exactly like {{tl|ambox}}, {{tl|imbox}}, {{tl|cmbox}} and {{tl|ombox}} their talk pages and related pages might also contain more details.
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息