Template:Gallery Section (Cargo): Difference between revisions

Template page
(update with custom URL to Special:ViewData, and add header, title, sort options)
m (add option to show a button to see cameos ("see cameos"))
Line 3: Line 3:
   |date=Date DESC
   |date=Date DESC
   |_pageName
   |_pageName
}}
}}}}<!--
}}<!--
-->{{#if:{{{title|}}}|{{#vardefine:header|{{#switch:{{{header|h3}}}
-->{{#if:{{{title|}}}|
{{#vardefine:header|{{#switch:{{{header|h3}}}
   |h2=<h2 style="display:inline;">{{{title}}}</h2>
   |h2=<h2 style="display:inline;">{{{title}}}</h2>
   |h3=<h3 style="display:inline;">{{{title}}}</h3>
   |h3=<h3 style="display:inline;">{{{title}}}</h3>
   |h4=<h4 style="display:inline;">{{{title}}}</h4>
   |h4=<h4 style="display:inline;">{{{title}}}</h4>
   |h5=<h5 style="display:inline;">{{{title}}}</h5>
   |h5=<h5 style="display:inline;">{{{title}}}</h5>
   |{{{title|}}} }}
   |{{{title|}}}
}}}}<!--
}}}}}}<!--
-->{{#vardefine:intro|<div>{{#var:header}}<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></div>
-->{{#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 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>}}<!--
-->{{#cargo_query:
-->{{#cargo_query:
tables=Files
tables=Files
Line 30: Line 30:
|caption field=Caption
|caption field=Caption
|image width={{{widths|250}}}
|image width={{{widths|250}}}
}}
}}<!--
</includeonly><noinclude>
--></includeonly><noinclude>
Create a section of the [[Template:Master Gallery]] based on information stored through [[Template:Gallery Metadata]].
Create a section of the [[Template:Master Gallery]] based on information stored through [[Template:Gallery Metadata]].


Line 48: Line 48:
|title=
|title=
|sort=
|sort=
|see all=
|see cameos=
}}
}}
</nowiki></pre>
</nowiki></pre>
Line 53: Line 55:
Reference [[Template:Gallery Metadata]] for character, location, weapon, source, section, and artist.
Reference [[Template:Gallery Metadata]] for character, location, weapon, source, section, and artist.


<code>|limits=</code> Optional, the max number of images to show before truncating and displaying a "show more" link. Defaults to 10000 (matching the default for [[Template:Gallery Section]]).
<code>|limits=</code> Optional, the max number of images to show before truncating and displaying a "show more" link. Defaults to 4.


<code>|widths=</code> Optional, the width of each image in the gallery. Defaults to 250 (matching the default for [[Template:Gallery Section]])
<code>|widths=</code> Optional, the width of each image in the gallery. Defaults to 250 (matching the default for [[Template:Gallery Section]])
Line 62: Line 64:


<code>|sort=</code> Optional. If set to <code>date</code>, the results will be sorted by descending date (with newer images after older ones).
<code>|sort=</code> Optional. If set to <code>date</code>, the results will be sorted by descending date (with newer images after older ones).
<code>|see all=</code> Optional. Change to <code>n</code> to hide the "see all" button that appears next to the header, linking to all results. True by default.
<code>|see cameos=</code> Optional. Change to <code>y</code> 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==
==See Also==

Revision as of 03:14, 1 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