Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Gallery/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{Fmbox|text=This template provides advanced gallery building functionality (fine-tuned formatting control, using Lua module and TemplateStyles). In the vast majority of cases the normal MediaWiki [[mw:Help:Images#Rendering_a_gallery_of_images|<nowiki><gallery></nowiki>]] tag is fully sufficient and should be used instead.|type=editnotice}} {{Lua|Module:Gallery}} {{Uses TemplateStyles|Template:Gallery/styles.css}} This template provides advanced gallery building functionality (fine-tuned formatting control). This template displays a gallery of images in an array, left-to-right in rows. Global parameters {{para|width}} and {{para|height}} control the size of all images in the gallery. The number of images per row is based upon the image width parameters and the width of the screen. The number of images per row can change when the user resizes the window. {| style="background: transparent;" |<pre>{{Gallery | title = | align = | footer = | style = | class = | state = | height = | width = | captionstyle = | File: | alt1= | Write a caption here | File: | alt2= | Write a caption here | File: | alt3= | Write a caption here | File: | alt4= | Write a caption here | File: | alt5= | Write a caption here }}</pre> |} == Parameters == === For each image === Specify a line of the following form for each image. : <code>|File:''Filename''</code> {{para|alt''n''|''Alt text''}} <code>|''Caption''</code> Where: : <code>|File:''Filename''</code> β the image's file name. Either <code>File:</code> or <code>Image:</code> prefix may be used : {{para|Alt''n''}} β alt attribute: {{para|alt1}} for the first image, {{para|alt2}} for the second image, etc :: <code>''Alt text''</code> β the [[w:Wikipedia:Alternative text for images|alternative text]] for the image, used by visually impaired or other readers who cannot see the image clearly. If omitted, the image's alt text will be blank. : <code>|''Caption''</code> β the caption under the image === Optional parameters === These parameters apply to the gallery: : {{para|title}} β The gallery's title : {{para|align}} β The alignment of the gallery on the page, left (default), center, or right; ignored when {{para|state}} is set : {{para|footer}} β Small, right-aligned text below the images : {{para|style}} β [[w:Cascading Style Sheets|CSS]] style directives for the whole gallery (see [[Wikipedia:Help:Cascading Style Sheets]]) : {{para|class}} β HTML class for the whole gallery : {{para|state}} β Sets the default state of collapsible galleries; use {{para|state|expanded}} or {{para|state|collapsed}}; collapsible galleries occupy the full page width : {{para|mode}} β Sets the mode used by the inner gallery tag. Common values include {{para|mode|packed}} and {{para|mode|nolines}} (see [[Wikipedia:Help:Gallery tag]] for more options) These parameters apply to all of the images in the gallery: : {{para|noborder}} β Cancel the border surrounding the images, use {{para|noborder|yes}} to set. : {{para|whitebg}} β Cancel the white background surrounding the images, use {{para|whitebg|no}} to set. : {{para|height}} β Maximum height of each image. If this parameter is not included, defaulting to 180 pixels. : {{para|width}} β Maximum width of each image, defaulting to 180 pixels. : {{para|captionstyle}} β [[w:Cascading Style Sheets|CSS]] style directives for the captions (see [[Wikipedia:Help:Cascading Style Sheets]]) : {{para|showfilename}} β Allow to show the file name of each image, use {{para|showfilename|yes}} to set. The image's original ratio of width to height cannot be modified by {{para|width}} or {{para|height}} β a rectangular image will not be made square if {{para|width}} and {{para|height}} are set to the same value. == Example == {{Gallery |title=Photographs |width=150 |perrow=4 |1=File:Oost amsterdam cs.JPG|2=Oostzijde Centraal Station |3=File:AMS central station 3.jpg|4=[[Stationsplein (Amsterdam)|Stationsplein]] Amsterdam |5=File:Asd cs afstand.JPG|6=Het station vanaf de [[Oude Kerkstoren]] |7=File:Amsterdam Centraal oostzijde.jpg|8=Het station vanuit het oosten |9=File:Oost amsterdam cs.JPG|10=Oostzijde Centraal Station |11=File:AMS central station 3.jpg|12=[[Stationsplein (Amsterdam)|Stationsplein]] Amsterdam |13=File:Asd cs afstand.JPG|14=Het station vanaf de [[Oude Kerkstoren]] |15=File:Amsterdam Centraal oostzijde.jpg|16=Het station vanuit het oosten |17=File:Oost amsterdam cs.JPG|18=Oostzijde Centraal Station |19=File:AMS central station 3.jpg|20=[[Stationsplein (Amsterdam)|Stationsplein]] Amsterdam |21=File:Asd cs afstand.JPG|22=Het station vanaf de [[Oude Kerkstoren]] |23=File:Amsterdam Centraal oostzijde.jpg|24=Het station vanuit het oosten |25=File:Oost amsterdam cs.JPG|26=Oostzijde Centraal Station |27=File:AMS central station 3.jpg|28=[[Stationsplein (Amsterdam)|Stationsplein]] Amsterdam |29=File:Asd cs afstand.JPG|30=Het station vanaf de [[Oude Kerkstoren]] |31=File:Amsterdam Centraal oostzijde.jpg|32=Het station vanuit het oosten |33=File:Oost amsterdam cs.JPG|34=Oostzijde Centraal Station |35=File:AMS central station 3.jpg|36=[[Stationsplein (Amsterdam)|Stationsplein]] Amsterdam |37=File:Asd cs afstand.JPG|38=Het station vanaf de [[Oude Kerkstoren]] |39=File:Amsterdam Centraal oostzijde.jpg|40=Het station vanuit het oosten }} === Sourcecode of example === <pre> {{Gallery |caption=Photographs |width=150 |perrow=4 |Image:Oost_amsterdam_cs.JPG|Oostzijde Centraal Station |Image:AMS_central_station_3.jpg|[[Stationsplein (Amsterdam)|Stationsplein]] Amsterdam |Image:Asd_cs_afstand.JPG|Het station vanaf de [[Oude Kerkstoren]] <!-- ... --> }} </pre> The source and idea for this template come from [[w:Template:Gallery]]. == Tracking categories == * {{clc|Pages using gallery with unknown parameters}} * {{clc|Pages using gallery with the captionstyle parameter}} == See also == * {{tlx|G}} and [[Module:Galeria]] * {{tlx|Gallery items}} * {{tlx|Multiple image}} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| [[Category:Gallery templates|{{PAGENAME}}]] }}</includeonly>
Summary:
Please note that all contributions to Red Letter Media Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RLMWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Category link with count
(
edit
)
Template:Clc
(
edit
)
Template:Dir
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Fmbox
(
edit
)
Template:Gallery
(
edit
)
Template:Gallery/styles.css
(
edit
)
Template:Lua
(
edit
)
Template:Mbox
(
edit
)
Template:Mbox/styles.css
(
edit
)
Template:Para
(
edit
)
Template:Strong
(
edit
)
Template:Template link expanded
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tlx
(
edit
)
Template:Uses TemplateStyles
(
edit
)
Module:Arguments
(
edit
)
Module:Gallery
(
edit
)
Module:List
(
edit
)
Module:Lua banner
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:String
(
edit
)
Module:TNT
(
edit
)
Module:TableTools
(
edit
)
Module:Template link general
(
edit
)
Module:Text
(
edit
)
Module:Uses TemplateStyles
(
edit
)
Module:Uses TemplateStyles/config
(
edit
)
Module:Yesno
(
edit
)
Toggle limited content width