Overwatch Wiki
(Undo revision 114378 by MomoRuns (talk))
Tag: Undo
(Add automatic next and prev using cargo)
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{| class="infoboxtable"
<includeonly>{{#vardefine:sort_key|{{#time:Y-m-d|{{#replace:{{BASEPAGENAME}}|Patch}}}}}}<!--
 
-->{{#vardefine:vbox_prev|{{{previous|<!--
 
-->{{#iferror:<!--
 
-->{{#expr:0+{{#dpl:<!--
 
-->|category=Patches<!--
 
-->|titlelt={{BASEPAGENAME}}<!--
 
-->|count=1<!--
 
-->|ordermethod=category,sortkey<!--
 
-->|order=descending<!--
 
-->|format=,,,<!--
 
-->|resultsheader=%PAGES%<!--
 
-->}}}}<!-- if the dpl query has no results
 
-->|&mdash;<!-- then print dash
 
-->|{{#dpl:<!-- else print link to version
 
-->|category=Patches<!--
 
-->|titlelt={{BASEPAGENAME}}<!--
 
-->|count=1<!--
 
-->|ordermethod=category,sortkey<!--
 
-->|order=descending<!--
 
-->|format=,[[%PAGE%]],,<!--
 
-->}}<!--
 
-->}}<!-- end of iferror
 
-->}}}}}<!--
 
 
-->{{#vardefine:vbox_next|{{{next|<!--
 
-->{{#iferror:<!--
 
-->{{#expr:0+{{#dpl:<!--
 
-->|category=Patches<!--
 
-->|titlegt={{BASEPAGENAME}}<!--
 
-->|count=1<!--
 
-->|ordermethod=category,sortkey<!--
 
-->|format=,,,<!--
 
-->|resultsheader=%PAGES%<!--
 
-->}}}}<!-- if the dpl query has no results
 
-->|&mdash;<!-- then print dash
 
-->|{{#dpl:<!-- else print link to version
 
-->|category=Patches<!--
 
-->|titlegt={{BASEPAGENAME}}<!--
 
-->|count=1<!--
 
-->|ordermethod=category,sortkey<!--
 
-->|format=,[[%PAGE%]],,<!--
 
-->}}<!--
 
-->}}<!-- end of iferror
 
-->}}}}}
 
 
{| class="infoboxtable"
 
 
|-
 
|-
 
! colspan="2" class="infoboxname" | {{{name|{{PAGENAME}}}}}
 
! colspan="2" class="infoboxname" | {{{name|{{PAGENAME}}}}}
Line 52: Line 7:
 
{{#if: {{{platform|}}} | {{!}} <div>Platform(s)</div> {{!!}} {{{platform}}} }}
 
{{#if: {{{platform|}}} | {{!}} <div>Platform(s)</div> {{!!}} {{{platform}}} }}
 
|-
 
|-
{{#if: {{#varexists: vbox_prev}} | {{!}} <div>Previous patch</div> {{!!}} {{#var: vbox_prev}} }}
+
{{!}} <div>Previous patch</div> {{!!}} {{#cargo_query:
  +
tables = Patches
  +
| fields = _pageName
  +
| where = date < "{{{date|{{Patch date|{{PAGENAME}} }} }}}"
 
| limit = 1
  +
| order by = date DESC
  +
| more results text =
  +
| default = N/A
  +
}}
 
|-
 
|-
{{#if: {{#varexists: vbox_next}} | {{!}} <div>Next patch</div> {{!!}} {{#var: vbox_next}} }}
+
| {{!}} <div>Next patch</div> {{!!}} {{#cargo_query:
  +
tables = Patches
  +
| fields = _pageName
  +
| where = date > "{{{date|{{Patch date|{{PAGENAME}} }} }}}"
  +
| limit = 1
  +
| order by = date ASC
  +
| more results text =
  +
| default = N/A
  +
}}
 
|-
 
|-
 
{{#if: {{{version|}}} | {{!}} <div>Version number</div> {{!!}} {{{version}}} }}
 
{{#if: {{{version|}}} | {{!}} <div>Version number</div> {{!!}} {{{version}}} }}
Line 61: Line 32:
 
{{#if: {{{source|}}} | {{!}} colspan="2" {{!}} ''{{{source}}}'' }}
 
{{#if: {{{source|}}} | {{!}} colspan="2" {{!}} ''{{{source}}}'' }}
 
|-
 
|-
  +
|-style="text-align:center;"
  +
|[[Patch Notes|All Patch Notes]]
 
|}
 
|}
  +
{{#cargo_store:_table=Patches
[[Category:Patches|{{#var:sort_key}}]]</includeonly><noinclude>
 
  +
| date = {{{date|{{Patch date|{{PAGENAME}} }} }}}
== Usage ==
 
 
| platform = {{{platform|}}}
 
 
| version = {{{version|}}}
<pre style="width: 750px;">
 
 
| source = {{{source|}}}
{{Infobox patch
 
  +
}}
| name =
 
 
[[Category:Patches]]</includeonly>
| platform =
 
  +
<noinclude>
| previous =
 
  +
{{doc}}
| next =
 
  +
{{#cargo_declare:_table=Patches
| version =
 
  +
| date=String
| source = [urlhere Source]
 
  +
| platform=String
  +
| version=String
  +
| source=String
 
}}
 
}}
 
[[Category:Infobox templates|{{PAGENAME}}]]
</pre>
 
 
[[Category:Infobox templates]]
 
 
</noinclude>
 
</noinclude>

Revision as of 20:05, 24 April 2020


Template-info Documentation

Infobox for patch notes.

Parameters

No description.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Date of patchdate

Date of patch shown on the patch notes, formatted as ISO 8601.

Example
2020-08-12
Auto value
{{Patch date|{{PAGENAME}}
Stringsuggested
Platforms updatedplatform

List of platforms affected. Use [[Template:Platform]] to list platforms.

Auto value
Stringrequired
versionversion

no description

Example
1.16.2
Stringsuggested
Patch note sourcesource

A link to the source of the patch notes.

Stringoptional
Name of the patchname

no description

Example
August 12, 2020 Patch
Auto value
{{PAGENAME}}
Stringdeprecated
Previous patchprevious

Optional. Manual override to previous patch link.

Auto value
Previous patch link from cargo.
Unknownoptional
Next patchnext

Optional. Manual override to next patch link.

Auto value
Next patch link from cargo.
Stringoptional

Empty template

{{Infobox patch
| date = 
| platform =
| source =
}}

This template defines the table "Patches". View table.