Loading AI tools
来自维基百科,自由的百科全书
這個模板為討論頁消息提示元模板。
此頁面是Template:Tmbox的模板文件。 此頁面可能包含了模板的使用說明、分類和其他內容。 |
此模板文件被引用於約301,000個頁面,佔全部頁面的4%。 為了避免造成大規模的影響,所有對此模板文件的編輯應先於沙盒、測試樣例或您的沙盒上測試。 測試後無誤的版本可以一次性地加入此模板文件中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
此模板使用Lua語言: |
本模板使用以下模板樣式: |
此模板的文檔不存在、不全面或不能詳細描述其功能及/或其代碼中的參數。請幫助擴充並改進其文檔。 |
這個模板被用來構建討論頁消息提示框,如{{central}}。 它提供了幾種不同的顏色。如果沒有給出圖像參數,則使用默認的圖像,而且它還有其他一些功能。
這個模板通常不應該被用於WikiProject橫幅。他們有特殊的需求,因此有自己的元模板。參見下面的 "另見 "部分的連結。
該模板與{{ambox}}模板工作原理相類似,並使用相同的參數。
在討論頁面上討論和公示後,我們現在部署這個模板。歡迎將任何在用戶討論頁面上使用的消息框轉換為使用這個元模板。如果你發現有什麼棘手的情況,那麼就在本模板的討論頁上列出,你會得到幫助。
當使用這個模板來構建討論頁消息提示框時,這些框應該像以前一樣包含說明性文字。(和以前一樣的文本或新的改進文本)。如果框中有更具體的圖片,或者你知道的更好的圖片,那麼就用它們來代替這裡顯示的默認圖片。
討論頁信息框的類型與所有其他命名空間的信息框遵循相同的命名慣例,但任何特定討論頁信息框的類型可能不像其他命名空間那樣明顯。 在決定通話頁消息框的類型時,請考慮以下準則:
一些用法:
{{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 = The message body text.
}}
以下示例為指定不同type參數但不指定圖片參數輸出的默認圖像
type=speedy——快刪模板 |
type=delete——刪除模板 |
type=content——大部分警告和提醒 |
type=style——較小警告和問題 |
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. |
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 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.
}}
type
image
image = [[File:Crystal package settings.png|40px]]
imageright
imageright = [[File:Nuvola apps bookcase.svg|40px]]
style
" "
but with the ending semicolons ;
. For example:
style = margin-bottom: 0.5em;
textstyle
textstyle = text-align: center;
text
small = yes |
type = style small = yes |
small
small = {{{small|}}}
small = yes image = [[File:Nuvola apps bookcase.svg|40px]] smallimage = [[File:Nuvola apps bookcase.svg|30px]] |
smallimage
smallimage = [[File:Crystal package settings.png|30px]]
small = yes imageright = [[File:Nuvola apps bookcase.svg|40px]] |
small = yes imageright = [[File:Nuvola apps bookcase.svg|40px]] smallimageright = none |
smallimageright
smallimageright = [[File:Nuvola apps bookcase.svg|30px]]
smalltext
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 {{tmbox/core}} which holds most of the code for {{tmbox}}, while {{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 parser functions and special characters in parameters.
For more technical details see the talk page. Since this template works almost exactly like {{ambox}}, {{imbox}}, {{cmbox}} and {{ombox}} their talk pages and related pages might also contain more details.
在訊息框(mbox)家族中的元模板:
{{ambox}}
:用於條目訊息框{{tmbox}}
:用於討論頁訊息框{{imbox}}
:用於圖像頁訊息框{{cmbox}}
:用於分類訊息框{{ombox}}
:用於其他頁面訊息框{{mbox}}
:有名字空間探測功能。某些消息框會用在幾類頁面並因此需要依據所用在的頁面來改變風格,這種情況下的消息框可以用此元模板。有相近關係的元模板:
Other pages:
WikiProject banners:
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.