今天是2024年8月3日 第31周 星期六
代人,时大变了。
我们生活在大地上,但我们的梦想超越天空。
「Template:Imbox/doc」修訂間的差異
小 |
小 (文本替换 - 替换“<br>”为“<br />”) |
||
行 84: | 行 84: | ||
| type = style | | type = style | ||
| image = [[File:Gnome-dev-camera.svg|42px]] | | image = [[File:Gnome-dev-camera.svg|42px]] | ||
− | | text = type = style <br> image = <nowiki>[[File:Gnome-dev-camera.svg|42px]]</nowiki> <br> 此图片用于{{tl|cleanup-image}}。 | + | | text = type = style <br /> image = <nowiki>[[File:Gnome-dev-camera.svg|42px]]</nowiki> <br /> 此图片用于{{tl|cleanup-image}}。 |
}} | }} | ||
{{imbox | {{imbox | ||
| type = move | | type = move | ||
| image = [[File:To Commons.svg|52px]] | | image = [[File:To Commons.svg|52px]] | ||
− | | text = type = move <br> image = <nowiki>[[File:To Commons.svg|52px]]</nowiki> <br> 此图片用于{{tl|copy to Wikimedia Commons}}。 | + | | text = type = move <br /> image = <nowiki>[[File:To Commons.svg|52px]]</nowiki> <br /> 此图片用于{{tl|copy to Wikimedia Commons}}。 |
}} | }} | ||
{{imbox | {{imbox | ||
| type = license | | type = license | ||
| image = [[File:Heckert GNU white.svg|48px]] | | image = [[File:Heckert GNU white.svg|48px]] | ||
− | | text = type = license <br> image = <nowiki>[[File:Heckert GNU white.svg|48px]]</nowiki> <br> 此图片用于GFDL license模板,如{{tl|GFDL}}。 | + | | text = type = license <br /> image = <nowiki>[[File:Heckert GNU white.svg|48px]]</nowiki> <br /> 此图片用于GFDL license模板,如{{tl|GFDL}}。 |
}} | }} | ||
== 特殊设定 == | == 特殊设定 == | ||
行 108: | 行 108: | ||
{{imbox | {{imbox | ||
| type = license | | type = license | ||
− | | image = [[File:Imbox license.svg|40px]] <br> [[File:Ambox warning yellow.svg|40px]] | + | | image = [[File:Imbox license.svg|40px]] <br /> [[File:Ambox warning yellow.svg|40px]] |
| imageright = [[File:Shuttle.svg|30px]] | | imageright = [[File:Shuttle.svg|30px]] | ||
− | | text = type = license <br> image = <nowiki>[[File:Imbox license.svg|40px]] <br> [[File:Ambox warning yellow.svg|40px]]</nowiki> <br> imageright = <nowiki>[[File:Shuttle.svg|30px]]</nowiki> | + | | text = type = license <br /> image = <nowiki>[[File:Imbox license.svg|40px]] <br /> [[File:Ambox warning yellow.svg|40px]]</nowiki> <br /> imageright = <nowiki>[[File:Shuttle.svg|30px]]</nowiki> |
}} | }} | ||
{{imbox | {{imbox | ||
| type = license | | type = license | ||
− | | image = [[File:Imbox license.svg|40px]] <br> [[File:Ambox warning yellow.svg|40px]] | + | | image = [[File:Imbox license.svg|40px]] <br /> [[File:Ambox warning yellow.svg|40px]] |
| imageright = [[File:Shuttle.svg|30px]] | | imageright = [[File:Shuttle.svg|30px]] | ||
| text = '''此文件是在[[public domain|公有领域]],因为它是由[[NASA|美国国家航空航天局]]创建的。''' | | text = '''此文件是在[[public domain|公有领域]],因为它是由[[NASA|美国国家航空航天局]]创建的。''' | ||
− | <br>请注意,使用NASA标志、徽章和徽标受美国法律的约束。<!-- Note that use of NASA logos, insignia and emblems are restricted per US law. --> | + | <br />请注意,使用NASA标志、徽章和徽标受美国法律的约束。<!-- Note that use of NASA logos, insignia and emblems are restricted per US law. --> |
}} | }} | ||
<!-- 目前不支持“below”参数。2008-11-09 | <!-- 目前不支持“below”参数。2008-11-09 | ||
行 126: | 行 126: | ||
| image = [[File:Imbox license.svg|40px]] | | image = [[File:Imbox license.svg|40px]] | ||
| text = | | text = | ||
− | type = license <br> image = <nowiki>[[File:Imbox license.svg|40px]]</nowiki> <br> below = <nowiki>{{imbox | type = content | text = '''本许可标签不推荐使用!''' }}</nowiki> | + | type = license <br /> image = <nowiki>[[File:Imbox license.svg|40px]]</nowiki> <br /> below = <nowiki>{{imbox | type = content | text = '''本许可标签不推荐使用!''' }}</nowiki> |
| below = | | below = | ||
{{imbox | {{imbox |
於 2020年6月29日 (一) 01:17 的修訂
![]() | 本模板原先來自中文維基百科的Template:Imbox/doc,依照 CC BY-SA 3.0 授權被引入;原始貢獻者的名字可以在這裡看到。 經過雙方編輯者的修改,本模板可能已與它的來源大不相同。 | ![]() |
Template:Template doc page viewed directly
這個是圖片信息框(image message box,imbox)元模板。
它被用來創建用於圖像頁的信息框模板,像{{EU image}}等。它提供了幾種不同的顏色;如果沒有給出圖片參數,它將使用缺省的圖片;它還有一些其他的特性。
本模板幾乎完全像{{ambox}}一樣工作,並且使用同樣的參數。
用法
簡單應用的例子:
{{imbox | text = 一些文字。}}
![]() | 一些文字。 |
複雜一些的例子:
{{imbox | type = style | image = [[File:Emblem-question-yellow.svg|40px]] | style = width: 400px; | textstyle = color: red; font-weight: bold; font-style: italic; | text = 消息框的主体文字。 }}
40px | 消息框的主體文字。 |
圖像信息框類型
下列示例使用了不同的type參數,但沒有使用圖片參數,因而它們使用了每個類型對應的缺省的圖片。
![]() | type=speedy – 速刪模板,如{{isd}}。 |
![]() | type=delete – 刪除類模板,如{{ifd}}。 |
![]() | type=content – 較嚴重的警告和問題,如{{non-free reduce}}。 |
40x40px | type=style – 較輕的警告和問題,如{{cleanup-image}}。 |
![]() | type=notice – 注意以及任意種類的信息,包括永久性的和臨時性的。 |
40x40px | type=move – 移動/重命名信息和提議,如{{rename media}}。 |
40x40px | type=protection – 頁面保護模板,如{{pp-protected}},當其顯示在一個圖像頁時。 |
40x40px | type=license – 許可模板,如{{GFDL}}。 |
40x40px | type=featured – 特色圖片模板,如{{FeaturedPicture}}。 |
其他圖片
上面展示的缺省圖片大多是為了方便使用。在許多情況下,使用更加特定的圖片可能更合適。下面這些例子使用了image參數來指定一個圖片,而不是使用缺省的圖片。
42px | type = style image = [[File:Gnome-dev-camera.svg|42px]] 此圖片用於{{cleanup-image}}。 |
52px | type = move image = [[File:To Commons.svg|52px]] 此圖片用於{{copy to Wikimedia Commons}}。 |
![]() | type = license image = [[File:Heckert GNU white.svg|48px]] 此圖片用於GFDL license模板,如{{GFDL}}。 |
特殊設定
一些其他的參數組合。
![]() | 未給出type和image(default) |
未給出type,並且image=none – 不使用圖片,而且text占用整個信息框區域。 |
40px ![]() | type = license image = [[File:Imbox license.svg|40px]] <br /> [[File:Ambox warning yellow.svg|40px]] imageright = [[File:Shuttle.svg|30px]] | 30px |
40px ![]() | 此文件是在公有領域,因為它是由美國國家航空航天局創建的。
請注意,使用NASA標誌、徽章和徽標受美國法律的約束。 | 30px |
參數說明
所有參數的列表:
{{imbox | type = speedy / delete / content / style / notice / move / protection / license / featured | image = none / [[File:Some image.svg|40px]] | imageright = [[File:Some image.svg|40px]] | style = CSS取值 | textstyle = CSS取值 | text = 消息框的主体文字。 }}
- type
- 如果未給出type參數,本模板缺省使用notice類型。那意味着它會有一個藍色的邊框。
- image
- 不帶此參數 = 如果未給出image參數,則本模板使用一個缺省的圖片。至於是哪一個缺省圖片則取決於type參數。
- 一幅圖片 = 應當是帶常見的維基標記的一幅圖片。通常設置為40px - 50px寬比較合適,這取決於圖像的長寬比。(但是此消息框能夠處理任意尺寸的圖片。)例如:
image = [[File:Gnome-dev-camera.svg|40px]]
- none = 意味着不使用圖片。
- imageright
- 不帶此參數 = 如果未給出imageright參數,那麼右側不會顯示圖片。
- 一幅圖片 = 應當是帶常見的維基標記的一幅圖片。通常設置為40px - 50px寬比較合適,這取決於圖像的長寬比。(但是此消息框能夠處理任意尺寸的圖片。)例如:
imageright = [[File:Nuvola apps bookcase.png|40px]]
- 任意內容 = 任意其他的你想顯示在右側的對象。
- style
- 一個可選的CSS取值,被整個消息框表格所用。不帶引號
" "
。例如:style = margin-bottom: 0.5em;
- textstyle
- 一個可選的CSS取值,被文本單元格所用。例如:
textstyle = text-align: center;
- text
- 消息框的主體文字。
技術細節
如果你需要在text參數中使用一些特殊字符的話,那麼就需要像這樣將它們換碼:
{{imbox | text = <div> 等号 = 与前后大括号{ }可以正常地使用。 但是管道符{{!}}与两个连着的后大括号}}则不能直接使用。 一起用同样要带nowiki标记|}}。 </div> }}
![]() | 等號 = 與前後大括號{ }可以正常地使用。 但是管道符|與兩個連着的後大括號}}則不能直接使用。 一起用同樣要帶nowiki標記|}}。 |
此模板使用CSS類來確定顯示風格,因此可被更換到其他風格。
在此元模板內使用了HTML的表格標示法,而沒有使用維基式的表格標示法。在製作元模板時這是一個常見的方法,因為維基式標示法存在一些缺陷。譬如,維基式標示法會加大模板擴展語法及參數中特殊字符使用的難度。
此元模板所用的缺省圖片用的是png格式的,而不是svg格式。其主要原因是在處理MediaWiki為svg圖片所渲染的透明背景時,一些老版本的網絡瀏 覽器會遇到一些麻煩。這裡的png格式圖片有手工優化過的透明背景顏色,因而在所有的瀏覽器中它們看上去都是好的。請注意,svg圖標只會在一些老版本的 瀏覽器中看上去有點不對頭,因此只有那些非常廣泛使用的圖標才值得費些功夫去做那種手工優化。
參見
在消息框(mbox)家族中有好幾個元模板: