模板:Scalable image
跳至導覽
跳至搜尋
File:Test Template Info-Icon - Version (2).svg 模板文件[檢視] [編輯] [歷史] [清除快取]
| CSS | 本模板使用以下模板樣式: |
概要[編輯]
本模板讓編者可以的在條目中加入大型圖像。如果圖像本身的寬度過長,會自動縮小。
使用方式[編輯]
{{Scalable image|圖像檔名|圖像展示寬度|圖像說明|模板寬度|模板位置|alt=輔助說明文字|frame=是否需要外框}}
圖像檔名為必填,不需前綴File:。圖像展示寬度為必填,內定單位為px,可省略單位。圖像說明參數為選填,若填入圖像說明則會自動加入縮圖外框。如果圖像說明中需要使用「等於符號」(=),請將使用|圖像說明替換成|3=圖像說明。模板寬度參數為選填,如果數值單位是像素,請在後方加入「px」;若數值是百分比,請在最後加入「%」。模板位置參數也是選填,但要使用此參數時需同時指定「模板寬度」參數。可指定模板在頁面上對齊的方向,數值可填入right或left。輔助說明文字是讓視覺障礙的讀者能瞭解圖片內容的文字說明,請參考維基百科:圖像的替代文字。是否需要外框決定圖像是否加上縮圖外框,如果你不想加,可填入no。
範例[編輯]
無圖像說明[編輯]
{{scalable image|Dew on grass Luc Viatour.jpg|2500px|
|alt=草上的露珠}}
較小版本[編輯]
{{scalable image|Dew on grass Luc Viatour.jpg|500px|
|alt=草上的露珠}}
有圖像說明[編輯]
{{scalable image|Dew on grass Luc Viatour.jpg|2500px|草上的露珠
|alt=草上的露珠}}
模板數據[編輯]
<templatedata>{ "description": "讓編者可以在條目中加入大型圖像。如果圖像本身的寬度過長,會自動縮小。", "params": {
"1": {
"label": "圖像檔名",
"description": "需要显示的图片",
"type": "string",
"required": true
},
"2": {
"label": "圖像展示寬度",
"description": "设置图像在页面显示的宽度,单位为px",
"type": "string",
"required": true
},
"3": {
"label": "圖像說明",
"description": "在图像下方显示的说明",
"type": "string",
"required": false
},
"4" : {
"label": "模板寬度",
"description": "限制边框在页面显示的宽度,如:400px或40%",
"type": "string",
"required": false
},
"5": {
"label": "模板位置",
"description": "可指定模板在页面上对齐的方向,数值可填入right、left、center或none",
"default": "center",
"type": "string",
"required": false,
"aliases": ["align"]
},
"alt" : {
"label": "輔助說明文字",
"description": "让视觉障碍的读者能了解图片内容的文字说明,详见WP:ALT",
"type": "string",
"required": false
},
"frame" : {
"label": "是否顯示外框",
"description": "使用no使外框不显示",
"default": "yes",
"type": "string",
"required": false
},
"tooltip" : {
"label": "是否顯示提示",
"description": "使用no使图像提示不显示",
"default": "yes",
"type": "string",
"required": false
}
} }</templatedata>
參見[編輯]
- {{Wide image}}——可自動加入捲軸
- {{Panorama}}——可自動加入捲軸,但可以設定高度