Community Central

READ MORE

Community Central
Community Central
Community Central

Galleries are collections of uploaded files and videos. There are two main gallery formats:

Basic syntax[]

The basic wikitext syntax to create a gallery is below. By default, captions appear below the images, but this behavior can change depending on the gallery type or mode. The link parameter functions the same as linking from an image thumbnail.

<gallery widths=150>
Example.jpg
Example2.png|caption text
Example3.png|link=Help:Contents
Example4.png|caption [[Help:Links|with a link]]|link=Help:Contents
...
</gallery>

Fandom galleries[]

Fandom wikis make use of the Fandom gallery format, which is vastly different from the default MediaWiki gallery format.

Fandom galleries support three display types; two of them are controlled by the type parameter in the <gallery> tag: default galleries, slideshows, and sliders, all explained below on their respective sections.

Default galleries[]

<gallery> is the default static grid of images. Captions are displayed below each image.

Here's an example of a generic gallery with images and captions:

<gallery>
Example1.png|Caption 1
Example2.png|Caption 2
Example3.png|Caption 3
</gallery>

Below is a list of all parameters supported by default galleries:

Description Format and options Default
Max image widths, in pixels widths=[number] 185
Images per row columns=[number] Fit to page
Gallery positioning position=[left/center/right] left
Spacing between images spacing=[small/medium/large] medium
Image orientation and cropping orientation=[none/landscape/portrait/square] none
Caption position captionposition=[within/below] below
Caption alignment captionalign=[left/center/right] left
Caption color captiontextcolor=[color code] Article text color
Caption size captionsize=[small/medium/large] medium
Border thickness bordersize=[none/small/medium/large] small
Border color bordercolor=[color code] Theme border color
Gallery caption caption=[text] No caption
"Navigation" modifier navigation=[true/false] false

Slideshows[]

<gallery type="slideshow"> creates a slideshow of the images that the user can manually browse through. Captions are only displayed on hover as an overlay.

Below we have an example of a generic slideshow with images and captions:.

<gallery type="slideshow">
Example.jpg|Caption 1
Example2.png|Caption 2
Example3.png|Caption 3
</gallery>

Note that slideshows float on one side, to the right of the page by default, or to the left when set so with the parameter position.
If this is not desired, you have to "clear" the float after the slideshow with something like <div style="clear:both;"></div>
On most wikis, there is a template for this, which is either named {{clear}} or {{clr}}, and often there is a shortcut {{-}} for this.

Below is a list of all parameters supported by slideshows:

Description Format and options Default
Max image widths, in pixels widths=[number] 300
Cropping crop=[true/false] false
Show recent uploads showrecentuploads=[true/false] false
Slideshow position position=[left/center/right] right
Slideshow caption caption=[text] No caption

Sliders[]

<gallery type="slider"> creates a stylized automatic slideshow with a maximum of four images. Captions are displayed as titles—use |linktext= at the end of each image to display more text. Images are resized to a set width of 670px.

Here's an example of a generic slider with images, captions and links to articles. Note that sliders are always centered horizontally.

<gallery type="slider">
Example.jpg|Caption 1|link=<linked-page-here>|linktext=Description 1
Example1.png|Caption 2|link=<linked-page-here>|linktext=Description 2
Example4.png|Caption 3|link=<linked-page-here>|linktext=Description 3
</gallery>


Caption 1
Caption 2
Caption 3

Caption 1

Description 1

Read more >

Caption 2

Description 2

Read more >

Caption 3

Description 3

Read more >

Caption 1
Caption 2
Caption 3


Sliders support only one parameter:

Description Format and options Default
Thumbnail orientation orientation=[bottom/right] bottom

MediaWiki galleries[]

Gamepedia wikis make use of the MediaWiki gallery format.

Modes[]

MediaWiki galleries support a variety of display modes, controlled by the mode parameter in the <gallery> tag:

  • traditional is the default static grid of images. Captions are displayed below each image.
  • nolines is the same as traditional but without any borders or padding around the images.
  • packed is the same as nolines but all images have the same height and small spacing between them.
  • packed-overlay is the same as packed but the captions are overlayed on top of the images.
  • packed-hover is the same as packed-overlay but each image's caption overlay only appears when the user hovers over the image.
  • slideshow creates a slideshow of the images that the user can manually browse through. Captions are displayed below each image.

Parameters[]

MediaWiki galleries allow the following optional parameters in the <gallery> tag:

  • mode=traditional creates a traditional gallery. See above for the different gallery modes available.
  • caption="text" displays a caption above the gallery. Only plain text is allowed. Double quotations must be used if any spaces are in the caption text.
  • widths=[number]px sets every image to a specific maximum width. Note that the parameter is plural (widths, not width).
  • heights=[number]px sets every image to a specific maximum height. Note that the parameter is plural (heights, not height).
  • perrow=[number] forces the gallery to show an exact number of images per row. The default is 0, which automatically adjusts the images based on the screen width.
  • showfilename=true will show the filenames for each individual image in their captions.
  • showthumbnails=true is only supported with mode=slideshow and displays a line of thumbnails below the slideshow.

Navigation galleries[]

Navigation galleries are designed for users to be sent to a specific page when clicking on an image. This is useful for a gallery of characters, episodes, etc. that have their own individual pages. On the mobile web, navigation galleries have an optimized appearance for touch devices. Navigation galleries are supported on both MediaWiki and Fandom formats.

To set a gallery as a navigation gallery, add navigation=true to the <gallery> tag. Then, add |link=PAGENAME to set the links for each image. For example, the above gallery can be converted into a navigation gallery with the following code:

<gallery navigation=true>
Example1.png|Caption 1|link=Help:Editing
Example2.png|Caption 2|link=Help:Adding images
Example3.png|Caption 3|link=Help:Videos
</gallery>

Adding a gallery in VisualEditor[]

Galleries can also be added in the VisualEditor and its source mode through a visual interface. However, gallery parameters can only be edited by modifying the wikitext source code.

  • Click the Edit button on an article.
  • If necessary, place the cursor in the editing area where you wish to position a gallery.
  • Click the Insert drop-down menu in the editor toolbar and select Gallery. The gallery-building modal window will pop up.
  • In the "Search images" text box, start typing the name of an image (technically any File: page). As you type, images and videos that match your input will appear in the space below. Continue typing until you find the one you want and then click it to select it. When an image/video is selected, a thumbnail of it appears in the list to the right under the heading "In the Gallery" and the Edit caption text field appears below the larger version of the selected media.
  • You may enter a caption for it (or leave it blank) and click the blue check-mark at the end of the text field. You should briefly see the message "Caption successfully saved" and then the Search function reappears with your latest search results.
  • Continue to search for images/videos and add them until you are done.
  • At any time, you may modify the "In the Gallery" list in the following ways:
    • Remove an image or video by clicking the × below it
    • Edit the caption by clicking the pencil icon below it
    • Drag-and-drop images/videos within the list to change the presentation order
  • When you are done, click Insert in the upper-right corner of the gallery builder window. The modal will close and the images/videos will appear in the edit window. NOTE: They may not appear in rows at first, or may have more items per row than will be displayed in the final product—you may have to save the page to see the correct formatting.
  • Once back in the edit interface, clicking on any image in the gallery will show the Gallery Edit button off to the side of the gallery and you may make further changes.
  • Save the page to finalize your changes.

See also[]

Further help and feedback[]