Difference between revisions of "Template:Gallery/doc"

From blackwiki
Jump to navigation Jump to search
imported>یوشیچی تویوهارا
m ("includeonly" must be used not "noinclude")
imported>Eubulides
(Merge improvements from Template:Image gallery/doc.)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
  
{{For|the cleanup tag|Template:cleanup-gallery}}
+
{{For|the cleanup tag|Template:Cleanup-gallery}}
  
This [[template:gallery]], using [[template:gallery/aux]], shows up to 30 images. Every image is embedded in its own HTML-table, and are floated left. The number of images per row is based upon the width specified and the width of the screen, which allows greater flexibility than the [[Wikipedia:Gallery tag|<gallery>]] tag.
+
This template shows up to 30 images in an array. The number of images per row is based upon the width specified and the width of the screen, which allows greater flexibility than the [[Wikipedia:Gallery tag|<gallery>]] tag.
  
 
For style guidelines about where galleries are appropriate, see [[WP:IG]].
 
For style guidelines about where galleries are appropriate, see [[WP:IG]].
 +
 +
This template is similar to {{tl|Image gallery}}, except that it does not support [[WP:ALT|alt text]] and thus does not produce galleries that are accessible to visually-impaired readers. Also, this template requires a "<code>File:</code>" or "<code>Image:</code>" prefix for image names, whereas {{tl|Image gallery}} does not. Both templates use {{tl|Gallery/aux}} to format individual images.
  
 
== Parameters ==
 
== Parameters ==
Line 11: Line 13:
 
=== Required ===
 
=== Required ===
  
There are several parameters that should be specified after the tranclusion '''Gallery''':
+
; |''Image''|''Caption'': Specify one of these lines for each image. '''''Image''''' is the image name (with a <code>File:</code> or <code>Image:</code> prefix). '''''Caption''''' is the caption; see [[WP:CAPTION]]. If no such lines are present, a gallery with a single question-mark image is produced. There is currently a limit of 30 such lines.
 
 
* '''lines''' the default is two, this parameter should be specified to the number of lines needed for the largest caption. If the specification is too low: the text will be cut off. If the specification is too high: excessive space is placed below the caption.
 
* <span style="color:#4444FF;"><span style="color:#000000; font-weight:bold;">|</span>[image]<span style="color:#000000; font-weight:bold;">|</span>[caption]</span> following the ''pipe'' symbol " [[Vertical bar|&#124;]] " (generally located above the enter key) the image location should be specified, if this parameter is not specified an image with a question mark is defaulted. Following a second ''pipe'', the caption should be specified, the default is a blank non-breaking space. Iterate the previous until all images are entered into the tranclusion, the limit is currently '''30'''.
 
  
 
=== Optional ===
 
=== Optional ===
  
There are several parameters that are optional to this transculsion:
+
; title: The gallery's title.
* '''title''' this parameter produces a title for the gallery
+
; width: (default 180) Maximum width and height of each image.
* '''width''' the default is 180px, this parameter specifies the maximum width and height of each image, and the width of each cell.
+
; lines: (default 2) The number of text lines needed for the largest caption. Blank lines are appended to smaller captions. A caption that does not fit is cut off.
  
 
== Example ==
 
== Example ==
=== Code ===
 
  
<pre>
+
{{pre2|scroll|<nowiki>{{Gallery
 +
|title=Cultural depictions of George Washington
 +
|lines=4
 +
|Image:Federal Hall NYC 27.JPG|The statue of Washington outside [[Federal Hall]] in [[New York City]], looking on [[Wall Street]].
 +
|Image:Mount Rushmore2.jpg|Construction on the George Washington portrait at [[Mount Rushmore]], c. 1932.
 +
|Image:2006 Quarter Proof.png|Washington is commemorated on the [[Quarter (United States coin)|quarter]].
 +
|Image:George Washigton Presidential $1 Coin obverse.png|Washington is also commemorated on some [[dollar coin (United States)|dollar coins]].
 +
}}</nowiki>}}
 +
 
 
{{Gallery
 
{{Gallery
|title=Title of gallery goes here
+
|title=Cultural depictions of George Washington
|footer=*Image credit: Wikipedia, the free encyclopedia<br />**and so on...
+
|lines=4
|width=150
+
|Image:Federal Hall NYC 27.JPG|The statue of Washington outside [[Federal Hall]] in [[New York City]], looking on [[Wall Street]].
|lines=2
+
|Image:Mount Rushmore2.jpg|Construction on the George Washington portrait at [[Mount Rushmore]], c. 1932.
|Image:Wiki.png|this is a caption
+
|Image:2006 Quarter Proof.png|Washington is commemorated on the [[Quarter (United States coin)|quarter]].
|Image:Wiki.png|
+
|Image:George Washigton Presidential $1 Coin obverse.png|Washington is also commemorated on some [[dollar coin (United States)|dollar coins]].
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|[[Help:Contents/Links|Links]] can be put in captions.
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used…
 
|Image:Wiki.png|
 
 
}}
 
}}
</pre>
 
  
=== Result ===
 
 
<div style="background:#FFFFFF;">
 
{{Gallery
 
|title=Title of gallery goes here
 
|width=150
 
|footer=*Image credit: Wikipedia (c)2008<br />**and so on...
 
|lines=3
 
|Image:Wiki.png|this is a caption*
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|[[Help:Contents/Links|Links]] can be put in captions.
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|
 
|Image:Wiki.png|Full [[MediaWiki]]<br />[[syntax]] may now be used&hellip;**
 
|Image:Wiki.png|
 
}}
 
</div>
 
 
== See also ==
 
== See also ==
* {{tl|cleanup-gallery}}, the template marking unencyclopedic image galleries.
+
* {{tl|Image gallery}}
 +
* {{tl|Cleanup-gallery}}, the template marking unencyclopedic image galleries.
 
* {{tl|Scroll gallery}}
 
* {{tl|Scroll gallery}}
  
Line 88: Line 58:
  
 
</includeonly>
 
</includeonly>
 
</div>
 

Revision as of 20:24, 29 July 2009

This template shows up to 30 images in an array. The number of images per row is based upon the width specified and the width of the screen, which allows greater flexibility than the <gallery> tag.

For style guidelines about where galleries are appropriate, see WP:IG.

This template is similar to {{Image gallery}}, except that it does not support alt text and thus does not produce galleries that are accessible to visually-impaired readers. Also, this template requires a "File:" or "Image:" prefix for image names, whereas {{Image gallery}} does not. Both templates use {{Gallery/aux}} to format individual images.

Parameters

Required

|Image|Caption
Specify one of these lines for each image. Image is the image name (with a File: or Image: prefix). Caption is the caption; see WP:CAPTION. If no such lines are present, a gallery with a single question-mark image is produced. There is currently a limit of 30 such lines.

Optional

title
The gallery's title.
width
(default 180) Maximum width and height of each image.
lines
(default 2) The number of text lines needed for the largest caption. Blank lines are appended to smaller captions. A caption that does not fit is cut off.

Example

Template:Pre2

See also

refresh page/purge cache