Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Gallery Section (Cargo): Difference between revisions

Template page
m (add option to show a button to see cameos ("see cameos"))
m (strip apostrophes from character names (like Taro and Susano'o) so they don't break the query)
Line 11: Line 11:
   |{{{title|}}}
   |{{{title|}}}
}}}}}}<!--
}}}}}}<!--
-->{{#vardefine:CHARACTER|{{#replace:{{{character|}}}|'|}}}}<!--
--><!--
-->{{#vardefine:intro|<div>{{#var:header}}<!--
-->{{#vardefine:intro|<div>{{#var:header}}<!--
-->{{#ifeq:{{{see all|}}}|n||<a target="_blank" href="{{#invoke:ViewData URL|Files|character={{{character|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|intro={{#var:header}}}}"><div class="bb character-grid center" style="margin-left:10px; display:inline-block; width:65px;"><div>see all</div></div></a>}}<!--
-->{{#ifeq:{{{see all|}}}|n||<a target="_blank" href="{{#invoke:ViewData URL|Files|character={{{CHARACTER|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|intro={{#var:header}}}}"><div class="bb character-grid center" style="margin-left:10px; display:inline-block; width:65px;"><div>see all</div></div></a>}}<!--
-->{{#ifeq:{{{see cameo|}}}|y|<a target="_blank" href="{{#invoke:ViewData URL|Files|cameo={{{character|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|intro={{#var:header}}}}"><div class="bbdw character-grid center" style="margin-left:10px; display:inline-block; width:100px;"><div>see cameos</div></div></a>}}<!--
-->{{#ifeq:{{{see cameo|}}}|y|<a target="_blank" href="{{#invoke:ViewData URL|Files|cameo={{{CHARACTER|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|intro={{#var:header}}}}"><div class="bbdw character-grid center" style="margin-left:10px; display:inline-block; width:100px;"><div>see cameos</div></div></a>}}<!--
--></div>}}<!--
--></div>}}<!--
-->{{#cargo_query:
-->{{#cargo_query:
tables=Files
tables=Files
|fields=_pageName, Caption, Date
|fields=_pageName, Caption, Date
|where={{#if:{{{character|}}}|Files.Characters HOLDS '{{{character|}}}'}} {{#if:{{{location|}}}|AND Files.Locations HOLDS '{{{location|}}}'}} {{#if:{{{weapon|}}}|AND Files.Weapons HOLDS '{{{weapons|}}}'}} {{#if:{{{artist|}}}|AND Files.Artists HOLDS '{{{artist|}}}'}} {{#if:{{{section|}}}|AND Files.Gallery_Sections HOLDS '{{{section|}}}'}} {{#if:{{{source|}}}|AND Files.Source HOLDS '{{{source|}}}'}}
|where={{#if:{{{character|}}}|Files.Characters HOLDS '{{#var:CHARACTER}}'}} {{#if:{{{location|}}}|AND Files.Locations HOLDS '{{{location|}}}'}} {{#if:{{{weapon|}}}|AND Files.Weapons HOLDS '{{{weapons|}}}'}} {{#if:{{{artist|}}}|AND Files.Artists HOLDS '{{{artist|}}}'}} {{#if:{{{section|}}}|AND Files.Gallery_Sections HOLDS '{{{section|}}}'}} {{#if:{{{source|}}}|AND Files.Source HOLDS '{{{source|}}}'}}
|order by={{#var:sort}}
|order by={{#var:sort}}
|limit={{{limit|4}}}
|limit={{{limit|4}}}

Revision as of 15:10, 3 August 2019

Create a section of the Template:Master Gallery based on information stored through Template:Gallery Metadata.

Usage

{{Gallery Section (Cargo)
|character=
|location=
|weapon=
|source=
|section=
|artist=
|limit=
|widths=
|header=
|title=
|sort=
|see all=
|see cameos=
}}

Reference Template:Gallery Metadata for character, location, weapon, source, section, and artist.

|limits= Optional, the max number of images to show before truncating and displaying a "show more" link. Defaults to 4.

|widths= Optional, the width of each image in the gallery. Defaults to 250 (matching the default for Template:Gallery Section)

|header= Optional, sets the header depth. Accepts the values h2, h3, h4, h5. Leaving this out will default the title to regular text.

|title= Optional, defines the text to be used as the header for this gallery section. (e.g. Birthday Art)

|sort= Optional. If set to date, the results will be sorted by descending date (with newer images after older ones).

|see all= Optional. Change to n to hide the "see all" button that appears next to the header, linking to all results. True by default.

|see cameos= Optional. Change to y to show a button to Special:ViewData that performs the same query, but with the character as a cameo instead. (e.g. Izayoi showing up in Hakumen's Arcade Mode)

See Also