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
(update with custom URL to Special:ViewData, and add header, title, sort options)
m (centered the how to; edited text for to make the requirements more clear)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
-->{{#vardefine:sort|{{#switch:{{{sort|}}}
-->{{Gallery Section (Cargo)/1|sort={{{sort|}}}|header={{{header|}}}|title={{{title|}}}|see_all={{{see_all|}}}|character={{{character|}}}|count_all={{{count_all|0}}}|count_cameos={{{count_cameos|0}}}|limit={{{limit|4}}}
  |date=Date DESC
  |_pageName
}}
}}<!--
}}<!--
-->{{#if:{{{title|}}}|
-->{{Gallery Section (Cargo)/2|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|count_cameos={{{count_cameos|}}}
{{#vardefine:header|{{#switch:{{{header|h3}}}
  |h2=<h2 style="display:inline;">{{{title}}}</h2>
  |h3=<h3 style="display:inline;">{{{title}}}</h3>
  |h4=<h4 style="display:inline;">{{{title}}}</h4>
  |h5=<h5 style="display:inline;">{{{title}}}</h5>
  |{{{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>
}}<!--
}}<!--
-->{{#cargo_query:
-->{{#vardefine:HowTo|<div class="tooltip" style="border-bottom:none;display:inline-block;text-align:center;width:100%;"><div class="tooltip">ⓘ How to add an image here<span class="tooltiptext" style="text-align:left;">To add an image to this section, <b style="color:salmon;">upload it</b> with <b style="color:salmon;">all</b> of the following categories:<br><code style="color:salmon;">{{#arraymap:{{{character|}}};{{{location|}}};{{{weapon|}}};{{{artist|}}};{{{section|}}};{{{source|}}}|;|x|<nowiki>[[Category:</nowiki>x]]|}}</code>
tables=Files
<br><b style="color:salmon;">OR</b> make sure the file has the following filled out on its page:<br><code style="color:salmon;"><nowiki>{{Gallery Metadata</nowiki><br>{{!}}characters={{{character|}}} {{#ifeq:{{{see_cameos|}}}|y|OR<br>{{!}}cameos={{{character|}}}}}<br>{{!}}locations={{{location|}}}<br>{{!}}weapons={{{weapon|}}}<br>{{!}}artists={{{artist|}}}<br>{{!}}section={{{section|}}}<br>{{!}}sources={{{source|}}}<br><nowiki>}}</nowiki></code></span></div></div>}}<!--
|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|}}}'}}
-->{{#ifeq:{{{see_cameos|}}}|y|{{#ifexpr: {{#var:count_total}} > 0|
|order by={{#var:sort}}
{{#var:header}} {{#var:HowTo}}
|limit={{{limit|4}}}
{{#invoke:Tabs|main
|intro={{#var:intro}}
|name={{{section|}}}{{{source|}}}
|default=
|containerclass=forceland
|more results text=
|tab1=Main
|format=gallery
|tab2=Cameos
|show bytes=0
|content1={{Gallery Section (Cargo)/Q1|character={{{character|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}}}
|show dimensions=0
{{Gallery Section (Cargo)/3|displayed={{{load_limit|4}}}|count_all={{{count_all|0}}}|load_limit=50|character={{#var:CHARACTER}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|sort={{#var:sort}}|widths={{{widths|}}} }}
|show filename=0
 
|caption field=Caption
|content2={{Gallery Section (Cargo)/Q1|cameo={{{character|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}}}
|image width={{{widths|250}}}
{{Gallery Section (Cargo)/3|displayed={{{load_limit|4}}}|count_all={{{count_cameos|0}}}|load_limit=50|cameo={{#var:CHARACTER}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|sort={{#var:sort}}|widths={{{widths|}}} }}
 
}}
}}
|{{#var:header}} {{#var:HowTo}}
{{Gallery Section (Cargo)/Q1|character={{{character|}}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}}}
{{Gallery Section (Cargo)/3|displayed={{{load_limit|4}}}|count_all={{{count_all|0}}}|load_limit=50|character={{#var:CHARACTER}}|location={{{location|}}}|weapon={{{weapon|}}}|artist={{{artist|}}}|section={{{section|}}}|source={{{source|}}}|sort={{#var:sort}}|widths={{{widths|}}}  
}}
}}
</includeonly><noinclude>
}}</includeonly><noinclude>
Create a section of the [[Template:Master Gallery]] based on information stored through [[Template:Gallery Metadata]].
{{Imbox Gallery Notice}}
Creates a section of the [[Template:Master Gallery]] based on information stored through [[Template:Gallery Metadata]].


==Usage==
==Usage==
Line 48: Line 44:
|title=
|title=
|sort=
|sort=
|see_all=True by default (use 'n' to turn off)
|see_cameos=False by default (use 'y' to turn on)
|count_all=
|count_cameos=
}}
}}
</nowiki></pre>
</nowiki></pre>
Line 53: Line 53:
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 61: Line 61:
<code>|title=</code> Optional, defines the text to be used as the header for this gallery section. (e.g. Birthday Art)
<code>|title=</code> Optional, defines the text to be used as the header for this gallery section. (e.g. Birthday Art)


<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). By default it sorts alphabetically.
 
<code>|see_all=</code> Optional. Controls the display of a "see all" button next to the header, that links to all results. It displays all the time by default. Use <code>|see all=n</code> to hide the button all the time. If <code>count_all</code> is given, then this button won't display unless there is overflow.
 
<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)
 
<code>|count_all=</code> Optional. Put a number here to display it next to the "see all" message (e.g. "see all 13"). If this number is entered, the template will check if the <code>see all</code> button needs to be shown and hide it if necessary.
 
<code>|count_cameos=</code> Optional. Put the number of cameo images here.


==See Also==
==See Also==

Latest revision as of 17:45, 3 April 2021

Creates 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=True by default (use 'n' to turn off)
|see_cameos=False by default (use 'y' to turn on)
|count_all=
|count_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). By default it sorts alphabetically.

|see_all= Optional. Controls the display of a "see all" button next to the header, that links to all results. It displays all the time by default. Use |see all=n to hide the button all the time. If count_all is given, then this button won't display unless there is overflow.

|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)

|count_all= Optional. Put a number here to display it next to the "see all" message (e.g. "see all 13"). If this number is entered, the template will check if the see all button needs to be shown and hide it if necessary.

|count_cameos= Optional. Put the number of cameo images here.

See Also