Template:Image Gallery: Difference between revisions
Jump to navigation
Jump to search
→Gallery with custom options: placeholder example |
OCD |
||
| Line 4: | Line 4: | ||
{{#if:{{{conditions|}}}|{{#arraymap:{{{conditions}}}|;|@@@|[[@@@]]|\s}}|}} | {{#if:{{{conditions|}}}|{{#arraymap:{{{conditions}}}|;|@@@|[[@@@]]|\s}}|}} | ||
{{#if:{{{or-conditions|}}}|OR [[Category:{{{1|{{#titleparts:{{PAGENAME}}|1}}}}}]] {{#arraymap:{{{or-conditions}}}|;|@@@|[[@@@]]|\s}}|}} | {{#if:{{{or-conditions|}}}|OR [[Category:{{{1|{{#titleparts:{{PAGENAME}}|1}}}}}]] {{#arraymap:{{{or-conditions}}}|;|@@@|[[@@@]]|\s}}|}} | ||
{{#ifeq:{{{ | {{#ifeq:{{{placeholders|y}}}|n|<!--only return results with an image-->[[{{#var:image-property}}::+]]}} | ||
| ?Has canonical name | | ?Has canonical name | ||
| ?{{#var:image-property}}# | | ?{{#var:image-property}}# | ||
Revision as of 22:52, 9 December 2025
Displays a gallery of images for a given category. The results of the semantic category query are formatted by {{Image gallery line}}.
Parameters
- category (unnamed parameter 1)
- Category of images to display. Defaults to the pagename. For example, a gallery on the page "Category:Daggers/Gallery" would produce a gallery for the daggers category.
- conditions
- Optional query terms. Semi-colon separated list of additional semantic query conditions to filter the category results.
- or-conditions
- Optional query terms. Semi-colon separated list of alternative semantic query conditions to filter the category results. The "OR" conditions will be combined with the conditions to merge two result sets, i.e.
[[Has foo::foo]] OR [[Has bar::bar]]. The category will always be included in the search filters.
- sort
- Optional. Comma-delimited list of properties to sort by. Default value: "Has canonical name"
- image-property
- Optional. Used to specify the image property to be displayed in the gallery. Defaults to "Has appearance".
- size
- Optional. Number. Used to specify the maximum height of the images in the gallery. Defaults to "200".
- show-placeholders
- Optional. Boolean. Set to 'n' to prevent the image placeholder from displaying for any pages without an image. By default, placeholders will be displayed for pages without images.
Examples
Basic gallery for a category
{{Image Gallery|Door}}
Gallery with additional filters
{{Image Gallery
| Resistance Weapons
| conditions = Has weapon type::Gladiator's Arm;Has canonical name::!~*Replica*
| or-conditions = Has weapon type::Gladiator's Arm;Has canonical name::~*Matte*
}}
Gallery with custom options
{{Image Gallery
| Patch 7.35 Items
| conditions = Has equipment supertype::Armor;Has armor type::Body
| image-property = Has female appearance
| show-placeholders = n
| size = 300
}}