Community Central

September comes to a close with This Month at Fandom, including cool data trends, Editors of the Month, and a summary of important updates you may have missed.

READ MORE

Community Central
Advertisement
Community Central

Galleries are collections of uploaded files and videos. There are two gallery formats: Fandom galleries, used on Fandom wikis, and MediaWiki galleries, used on legacy Gamepedia wikis. Both formats are explained in further detail below.

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
Example.jpg|caption text
Example.jpg|link=Help:Contents
Example.jpg|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.

Types

Fandom galleries support three display types, controlled by the type parameter in the <gallery> tag:

  • type=gallery is the default static grid of images. Captions are displayed below each image.
  • type=slideshow creates a slideshow of the images that the user can manually browse through. Captions are only displayed on hover as an overlay.
  • 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.

Below are examples of the display types:

Parameters

Fandom galleries allow the following optional parameters in the <gallery> tag, depending on the gallery type.

Default galleries

Description Format and options Default
Max image widths, in pixels widths=[number] 185
Images per row columns=[number]
perrow=[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

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

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

MediaWiki galleries

Legacy 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 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 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, at the end of each image's line, 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>
Example gallery-1.png|Default|link=Bowser
Example slideshow.png|Slideshow|link=Mr. Krabs
Example slider.png|Slider|link=Genshin Impact
</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 for media" text box, start typing the name of a 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 select 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.

Read more

Further help and feedback

Advertisement