Template:Gallery box/doc
Jump to navigation
Jump to search
This is the documentation subpage of Template:Gallery box. It contains usage information that is not part of the underlying template.
Template:Gallery box
Creates a collapsible, styled container for displaying image galleries. The box renders collapsed by default and includes a header with an automatically chosen icon based on the category name.
Usage
{{gallery box
| name = Weapons
| gallery = <gallery>...</gallery>
}}
Parameters
| Parameter | Description | Required |
|---|---|---|
name
|
The display title of the box header. Also controls which icon appears to the left of the title. See Supported names below. | Optional |
gallery
|
The content to display inside the collapsible area. Typically a <gallery> block or {{Image Gallery}} call, but any wikitext is accepted.
|
Optional |
Supported names and icons
The name parameter controls an icon that appears to the left of the header title. The following values have a dedicated icon:
name value
|
Icon used |
|---|---|
Weapons
|
gladiator's arm icon1.png
|
Outfits
|
Outfit glamour.png
|
Accessories
|
earrings slot icon1.png
|
| Any other value | No icon; the title renders alone. |
Behavior
- The box uses the MediaWiki
mw-collapsibleclass and is collapsed by default (mw-collapsed). - Clicking the header toggles the gallery open or closed.
- Styles are loaded from Template:Gallery box/styles.css.
Examples
Basic usage with a recognized category name:
{{gallery box
| name = Weapons
| gallery = <gallery>
File:Sword.png|Iron Sword
File:Axe.png|Iron Axe
</gallery>
}}
Using a custom name (no icon):
{{gallery box
| name = Seasonal Items
| gallery = <gallery>
File:Seasonal1.png|Spring Hat
</gallery>
}}
Adding new icon categories
To add support for a new category name, edit the #switch block in the template and add a new case:
| NewCategory = [[File:NewIcon.png|30px|link=]]