模板:Multiple image
| 警告 | 此模板被引用於約12,000個頁面。 為了避免造成大規模的影響,所有對此模板的編輯應先於沙盒、測試樣例或您的沙盒上測試。 測試後無誤的版本可以一次性地加入此模板中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
| File:Lua-Logo.svg | 此模板使用Lua語言: |
| CSS | 本模板使用以下模板樣式: |
本模板可生成一個垂直或水平排列多張圖片的框,可以水平或者垂直組合,並給整個框或者單獨的圖片添加說明文字。
適當選擇參數可以讓模板自動將圖像大小調整為給定的總寬度,每個圖像具有相同的高度。
語法和參數[編輯]
提供height[n]和total_width參數用於自動調整尺寸。
- 自動將所有圖像調整為相同的高度和給定的總寬度
{{Multiple image|total_width = 600 <!-- 布局参数 --> | align = <!-- right(默认)、left、center、none --> | direction = <!-- horizontal(默认)、vertical --> | background color = <!-- 框的背景颜色,web颜色,例如#33CC00 --> | width = <!-- 每个图像宽度显示的像素数(整数,省略“px”后缀);会被下面的“width[n]”覆盖 --> | caption_align = <!-- left(默认)、center、right --> | image_style = <!-- border:1;(默认) --> | image_gap = <!-- 5(默认)--> <!-- 顶部 --> | header_background = <!-- 顶部的背景颜色,web颜色形式,如#33CC00 --> | header_align = <!-- center(默认)、left、right --> | header = <!-- 顶部文本 --> <!--图像1--> | image1 = <!-- 仅文件名称,不含“File:”或“Image:”前缀 --> | width1 = <!-- 图像的显示宽度,会忽略上面的“width” --> | alt1 = | link1 = | thumbtime1 = | caption1 = <!--图像2--> | image2 = <!-- 仅文件名称,不含“File:”或“Image:”前缀 --> | width2 = <!-- 图像的显示宽度,会忽略上面的“width” --> | alt2 = | link2 = | thumbtime2 = | caption2 = <!-- 依此类推,最多10个(image10) --> <!-- 底部 --> | footer_background = <!-- 底部的背景,web颜色形式,如#33CC00 --> | footer_align = <!-- left(默认)、center、right --> | footer = <!-- 底部的文本 --> }}
- 沒有將所有圖像自動調整為相同高度的大小
{{multiple image <!-- 布局参数 --> | align = <!-- right(默认)、left、center、none --> | direction = <!-- horizontal(默认)、vertical --> | background color = <!-- box background --> | total_width = <!-- 所有图片的总宽度的像素数(整数,忽略“px”后缀) --> | caption_align = <!-- left(默认)、center、right --> <!-- 顶部 --> | header_background = | header_align = <!-- center(默认)、left、right --> | header = <!--图像1--> | image1 = <!-- 仅文件名称,不含“File:”或“Image:”前缀 --> | alt1 = | link1 = | thumbtime1 = | caption1 = <!--图像2--> | image2 = <!-- 仅文件名称,不含“File:”或“Image:”前缀 --> | alt2 = | link2 = | thumbtime2 = | caption2 = <!-- 依此类推,最多10个(image10) --> <!-- 底部 --> | footer_background = | footer_align = <!-- left(默认)、center、right --> | footer = }}
| 參數 | 描述 |
|---|---|
| align | right (預設)、left、center |
| direction | horizontal (預設)、vertical |
| background color | 設置包含了各圖像的框的背景顏色。 |
| header_background | |
| header_align | center (預設)、left、right |
| header | |
| width | 用於給每個圖像(覆蓋下面的width[n])設置相同的寬度。如果想要不同的圖像寬度,包括如果要將圖像大小調整為固定的總寬度,則不要使用此參數。 |
| total_width | 用於將圖像調整為相同的高度,總寬度為這個值。不要同時使用total_width和width。 |
| image[n] | ([n] = 1到10) 第n個圖像的檔案名稱。 |
| width[n] | (同上) 兩個含義:(1) 第n個圖像的寬度(像素數,省略「px」)。會被width覆蓋(如果設置了)。(2) 如果提供了total_width參數以將所有圖像的大小調整為相同的寬度的指定的高度,則此值為原先的第n個圖像的總寬度。 |
| height[n] | (同上) 如果提供了total_width以將所有圖像的大小調整為相同的高度和指定的寬度,則此值為第n個圖像的完整高度。其他情況下會忽略。 |
| alt[n] | (同上) 第n個圖像的替代文字。 |
| link[n] | (同上) 第n個圖像連結至的頁面。
|
| thumbtime[n] | (同上) 使用影片檔時,設置最初顯示的時間位置。 |
| caption[n] | (同上) 第n個圖像的描述文字。 |
| caption_align | left (預設)、center、right |
| footer_background | |
| footer_align | left (預設)、center、right |
| footer | 包含整個框寬度範圍的描述文字,區別與單獨的圖像。如有可能,請避免「left」和「right」,因此銩裝置可能會將圖片垂直顯示。 |
範例[編輯]
{{multiple image
| width = 60
| image1 = Yellow card.svg
| alt1 = 黃色橢圓形邊緣
| image2 = Red card.svg
| alt2 = 紅色橢圓形邊緣
| footer = 黃牌用於警告,紅牌用於罰下。
}}
{{multiple image
| align = left
| direction = vertical
| width = 200
| header = [[Portable Network Graphics|PNG]] 透明度示範
| image1 = PNG transparency demonstration 1.png
| alt1 = 彩色骰子加白色背景
| caption1 = 具有8位元透明度圖層的PNG圖像...
| image2 = PNG transparency demonstration 2.png
| alt2 = 彩色骰子加方格背景
| caption2 = ...這裏覆蓋一個方格的背景。
}}
使用background color[編輯]
{{multiple image
| background color = #BBDD99
| width = 160
| image1 = Adoxa_moschatellina_210406.jpg
| alt1 = 綠草與一些小黃白色的花
| image2 = Adoxa_moschatellina_210406a.jpg
| alt2 = 在綠色葉子背景前的三朵小白色和黃色的花
| image3 = adoxa_moschatellina_blatt.jpeg
| alt3 = 一棵植物的葉,每組有三個,每個有三塊葉
| footer_background = #BBDD99
| footer_align = center
| footer = Adoxa([[五福花]])
}}
使用連結 (link[n])[編輯]
{{multiple image
| align = left
| image1 = Frecklesmule.jpg
| width1 = 143
| alt1 = A mule
| link1 = 骡子
| caption1 = A mule<br />(骡子 ''luózi'')
| image2 = Donkey 1 arp 750px.jpg
| width2 = 150
| alt2 = 驴子
| link2 =
| caption2 = A donkey<br />(驴子 ''lǘzi'')
| image3 = Rainbow_trout.png
| width3 = 91
| alt3 = 鲑鱼
| caption3 = A fish<br />({{lang|zh|2=鱼}} ''yú'')
| footer = 骡子的图像链接至[[骡子]],驴子的图像则没有链接,鲑鱼的图像链接至图像的描述页面。
}}
多行[編輯]
要建立一系列的圖像並帶有多行,使用|perrow=,其值可以是一個單獨的數字,或者是由/分隔的一組數字。此功能可以和|total_width=組合使用,用於多行圖片相同的總寬度。
{{multiple image|perrow = 2|total_width=300
| image1 = Kern_Theodolit_DKM2-A.jpg |width1=319|height1=425
| image2 = Total-Robotic-Station.jpg |width2=1728|height2=3072
| image3 = DumpyLevel.jpg |width3=1600|height3=1200
| image4 = GPS_Survey_Equipment_at_Weir_Dyke_Bridge_-_geograph.org.uk_-_336908.jpg|width4=427|height4=640
| footer = 测量设备。从左上角顺时针:光学经纬仪、机器人全站仪、光学水准仪、实时运动学GPS基站。
}}
模板資料[編輯]
<templatedata> { "description": "建立一個帶有兩個或者多個水平或者豎直排行的圖像的框,並帶有整個框或者單獨的每個圖像的描述文字。", "format": "block", "params": { "align": { "type": "string", "label": "對齊", "default": "right", "description": "設置圖像框周圍的文字環繞,其中「none」將框放置在不帶文字環繞的左邊緣,「center」將框放在不帶文字環繞的中心,「left」和「right」指的是帶文字環繞框在螢幕上的位置。", "example": "left/right/center/none", "suggestedvalues": [ "left", "center", "right", "none" ] }, "direction": { "default": "horizontal", "type": "string", "label": "方向", "description": "平鋪圖像的方向。", "example": "horizontal/vertical", "suggested": true, "suggestedvalues": [ "horizontal", "vertical" ] }, "total_width": { "type": "number", "label": "框寬度", "description": "用於將圖像縮放到相同的高度和總寬度。不要同時使用total_width和width。以像素為單位的整數寬度;沒有「px」字尾", "example": "400", "suggested": true }, "perrow": { "type": "string", "label": "行佈局", "description": "建立有多行的一系列圖像。值可以是單個數字,也可以是每行由「/」分隔的一組數字。可以與total_width組合使用以自動調整圖像大小。", "example": "1 / 2 / 1" }, "width": { "type": "number", "label": "圖像寬度", "description": "會覆蓋width1、width2、width3等,如果你需要為圖像設置不同的寬度,不要使用此參數。整數,單位為像素,但不帶「px」字尾。", "example": "200" }, "background color": { "type": "string", "label": "背景顏色", "description": "定義框的邊框和圖像之間的背景色。變更背景可能影響無障礙訪問,請儘可能避免。", "example": "#EEFFGG或red" }, "caption_align": { "default": "left", "type": "string", "label": "描述文字的對齊", "example": "left/right/center", "suggestedvalues": [ "left", "center", "right" ] }, "image1": { "description": "第1個圖像的名稱。僅檔案名稱,不帶「File:」或「Image:」字首。", "type": "wiki-file-name", "example": "example.jpg", "suggested": true, "required": true, "label": "圖像1" }, "width1": { "description": "第1個圖像的寬度。", "type": "number", "label": "寬度1" }, "alt1": { "type": "line", "description": "第1個圖像的替代文字。", "label": "替代文字", "suggested": true }, "caption1": { "type": "content", "description": "第1個圖像的描述文字。", "suggested": true, "label": "描述1" }, "link1": { "type": "wiki-page-name", "description": "第1個圖像連結至的頁面。如果沒有指定,則圖像連結至描述頁面。如果指定為空值,則沒有連結,根據WP:ALT,當圖像僅用途裝飾時適用於這種情況。", "label": "連結1" }, "thumbtime1": { "type": "string", "description": "如果第1個圖像是Ogg Theroa檔案,設置初始位置的時間。秒數,或者是「時:分:秒」形式。", "label": "幀時間1" }, "image2": { "example": "example.jpg", "suggested": true, "label": "圖像2", "type": "wiki-file-name" }, "width2": { "type": "number", "label": "寬度2" }, "alt2": { "label": "替代文字2", "type": "line", "suggested": true }, "caption2": { "type": "content", "suggested": true, "label": "描述2" }, "link2": { "type": "wiki-page-name", "label": "連結2" }, "thumbtime2": { "type": "string", "label": "幀時間2" }, "image3": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像3" }, "width3": { "type": "number", "label": "寬度3" }, "alt3": { "type": "line", "label": "替代文字3" }, "caption3": { "label": "描述3", "type": "content" }, "link3": { "label": "連結3", "type": "wiki-page-name" }, "thumbtime3": { "type": "string", "label": "幀時間3" }, "image4": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像4" }, "width4": { "type": "number", "label": "寬度4" }, "alt4": { "type": "line", "label": "替代文字4" }, "caption4": { "label": "描述4", "type": "content" }, "link4": { "label": "連結4", "type": "wiki-page-name" }, "thumbtime4": { "type": "string", "label": "幀時間4" }, "image5": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像5" }, "width5": { "type": "number", "label": "寬度5" }, "alt5": { "type": "line", "label": "替代文字5" }, "caption5": { "label": "描述5", "type": "content" }, "link5": { "label": "連結5", "type": "wiki-page-name" }, "thumbtime5": { "type": "string", "label": "幀時間5" }, "image6": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像6" }, "width6": { "type": "number", "label": "寬度6" }, "alt6": { "type": "line", "label": "替代文字6" }, "caption6": { "label": "描述6", "type": "content" }, "link6": { "label": "連結6", "type": "wiki-page-name" }, "thumbtime6": { "type": "string", "label": "幀時間6" }, "image7": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像7" }, "width7": { "type": "number", "label": "寬度7" }, "alt7": { "type": "line", "label": "替代文字7" }, "caption7": { "label": "描述7", "type": "content" }, "link7": { "label": "連結7", "type": "wiki-page-name" }, "thumbtime7": { "type": "string", "label": "幀時間7" }, "image8": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像8" }, "width8": { "type": "number", "label": "寬度8" }, "alt8": { "type": "line", "label": "替代文字8" }, "caption8": { "label": "描述8", "type": "content" }, "link8": { "label": "連結8", "type": "wiki-page-name" }, "thumbtime8": { "type": "string", "label": "幀時間8" }, "image9": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像9" }, "width9": { "type": "number", "label": "寬度9" }, "alt9": { "type": "line", "label": "替代文字9" }, "caption9": { "label": "描述9", "type": "content" }, "link9": { "label": "連結9", "type": "wiki-page-name" }, "thumbtime9": { "type": "string", "label": "幀時間9" }, "image10": { "type": "wiki-file-name", "example": "example.jpg", "label": "圖像10" }, "width10": { "type": "number", "label": "寬度10" }, "alt10": { "type": "line", "label": "替代文字10" }, "caption10": { "label": "描述10", "type": "content" }, "link10": { "label": "連結10", "type": "wiki-page-name" }, "thumbtime10": { "type": "string", "label": "幀時間10" }, "image_gap": { "type": "number", "label": "圖像間隔", "description": "設置相鄰的圖像之間的間隔。整數,單位為像素,沒有「px」字尾。", "example": "20", "default": "5" }, "image_style": { "type": "string", "label": "圖像樣式", "description": "覆蓋圖像框的預設樣式。" }, "header": { "type": "content", "label": "頂部", "description": "整個框上方的頂部文字。" }, "header_background": { "type": "string", "label": "頂部背景", "description": "定義頂部文字的背景顏色。改變背景可能會影響無障礙訪問,請儘可能避免。", "example": "#EEFFGG或red" }, "header_align": { "default": "center", "type": "string", "label": "頂部對齊", "example": "left/right/center" }, "footer": { "type": "content", "label": "底部", "description": "整個框範圍的描述文字,不同於獨立的圖像。如有可能,避免left和right,因為流動裝置可能會像圖像垂直顯示。" }, "footer_background": { "type": "string", "label": "底部背景", "description": "定義底部文字的背景顏色。改變背景可能會影響無障礙訪問,請儘可能避免。", "example": "#EEFFGG或red" }, "footer_align": { "default": "left", "type": "string", "label": "底部對齊", "example": "left/right/center", "suggestedvalues": [ "left", "center", "right" ] }, "border": { "label": "顯示或隱藏框", "description": "使用值「infobox」以在資訊框內使用時將邊框隱藏。", "suggestedvalues": [ "infobox" ] } } }</templatedata>
參見[編輯]
- {{Gallery}}
- {{Image array}}
- {{Image frame}}
- {{Photomontage}}