模板:Scalable image/doc

维基百科,自由的百科全书
跳转到导航 跳转到搜索

概要[编辑]

本模板让编者可以的在条目中加入大型图像。如果图像本身的宽度过长,会自动缩小。

使用方式[编辑]

{{Scalable image|图像档名|图像展示宽度|图像说明|模板宽度|模板位置|alt=辅助说明文字|frame=是否需要外框}}
  • 圖像檔名为必填,不需前缀File:
  • 圖像展示寬度为必填,内定单位为px,可省略单位。
  • 圖像說明参数为选填,若填入图像说明则会自动加入缩图外框。如果图像说明中需要使用“等于符号”(=),请将使用 |圖像說明替换成|3=圖像說明
  • 模板寬度参数为选填,如果数值单位是像素,请在后方加入“px”;若数值是百分比,请在最后加入“%”。
  • 模板位置参数也是选填,但要使用此参数时需同时指定“模板宽度”参数。可指定模板在页面上对齐的方向,数值可填入rightleft
  • 輔助說明文字是让视觉障碍的读者能了解图片内容的文字说明,请参考维基百科:图像的替代文字
  • 是否需要外框决定图像是否加上缩图外框,如果你不想加,可填入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}}——可自动加入卷轴,但可以设定高度