Help:Image galleries
General
It's easy to make a gallery of thumbnails with the <gallery>
tag. The syntax is:
<gallery> File:file_name.ext|caption|alt=alt language File:file_name.ext|caption|alt=alt language {...} </gallery>
Note that the image code is not enclosed in brackets when enclosed in gallery tags.
Captions are optional, and may contain wiki links or other formatting. Some of the parameters controlling thumb output can also be used here, specifically the one's that modify the file (as opposed to one's that control where in the page the image falls). For example, with multi-paged media like pdfs, you can use code like page=4
.
The File:
prefix can be omitted.
for example:
<gallery> File:Example.jpg|Item 1 File:Example.jpg|a link to [[Help:Contents]] File:Example.jpg File:Example.jpg|alt=An example image. It has flowers File:Example.jpg| ''italic caption'' File:Example.jpg|on page "{{PAGENAME}}" </gallery>
is formatted as:
a link to Help:Contents
Modes
The experimental mode parameter is taking options traditional, nolines, packed, packed-overlay, and packed-hover. Traditional is the default gallery mode. Nolines is like traditional, but with less borders. packed causes images to have the same height, but different widths, with little space between the images. "packed-overlay" allows the caption to be overlaid on top of the image. Last of all "packed-hover" is like "packed-overlay", but with the caption only showing up on hover.
packed-hover
For example:
<gallery mode="packed-hover"> File:Entropia Universe Port Atantis Harbour.jpg|[[Port Atlantis|Port Atlantis Harbour]] File:Entropia Universe Planet Calypso Mulciber.jpg|[[Creature:Mulciber|Mulciber]] File:Entropia Universe ROCKtropia Zomhattan at night.jpg|Zomhattan at night File:Entropia Universe ROCKtropia No Way Out Maximum Security Prison.jpg|[[No Way Out Maximum Security Prison]] File:Todd Verdeyen Next Island 01.jpg|Tropical paradise File:Next_Island_Ancient_Greece_22-Nov-2010-04.jpg|[[Ancient Greece]] File:Terranix_Male_01.jpg|[[Creature:Terranix|Terranix Male]] (wallpaper) File:Monria appartments.jpg|Crater with habitats </gallery>
Gives (mode: packed-hover):
Terranix Male (wallpaper)
traditional
mode="traditional"
Terranix Male (wallpaper)
nolines
mode="nolines"
Terranix Male (wallpaper)
packed
mode="packed"
Terranix Male (wallpaper)
packed-overlay
mode="packed-overlay"
Optional attributes
The gallery tag itself takes several additional parameters, specified as attribute name-value pairs:
<gallery {parameters}> {images} </gallery>
caption="{caption}"
: (caption text between double quotes for more than a word) sets a caption centered atop the gallery.widths={width}px
: sets the widths of the images, default 120px. Note the plural, widthsheights={heights}px
: sets the (max) heights of the images.perrow={integer}
: sets the number of images per row. 0 means automatically adjust based on width of screenshowfilename={anything}
: Show the filenames of the images in the individual captions for each imagemode={traditional|nolines|packed|packed-hover|packed-overlay}
: See section above
Please note: The widths and heights parameters are taken more as suggestions then strict values for packed (and related) modes. Packed modes will adjust the width of images in order to make each row the same length.
Example:
Coding:
<gallery widths=60px heights=60px perrow=7 caption="sunflowers are groovy"> File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg </gallery>
Result:
Links, references, contributors, categories
- Parts of this page originally copied from http://www.mediawiki.org/wiki/Help:Images