Template:Infobox class: Difference between revisions

From TF2 Classic Wiki
Jump to navigation Jump to search
m (Technochips moved page Template:ClassInfobox to Template:Infobox class without leaving a redirect: proper name)
(Reduced images to 256px, which is their resolution)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{| class="wikitable" align=right width=200px
<includeonly>
{| class="infobox" width=320px
|+
|+
! colspan="2" | {{#if: {{{title|}}} | {{{title|}}} | {{PAGENAME}}}}
! class="infobox-title" colspan="2" | {{{title|{{PAGENAME}}}}}
{{#ifexist: File:{{#if: {{{image|}}}|{{{image|}}}|{{PAGENAME}}}} RED.webp |
{{#ifexist: File:{{{image|{{PAGENAME}}}}} RED.png |
{{!}}-
{{!}}-
{{!}} colspan="2" {{!}}
{{!}} class="infobox-image" colspan="2" {{!}}
<tabber>RED=[[File:{{#if: {{{image|}}}|{{{image|}}}|{{PAGENAME}}}} RED.webp|center|frameless]]
{{Switcher
|-|BLU=[[File:{{#if: {{{image|}}}|{{{image|}}}|{{PAGENAME}}}} BLU.webp|center|frameless]]
|[[File:{{{image|{{PAGENAME}}}}} RED.png|center|frameless|256px]]
|-|GRN=[[File:{{#if: {{{image|}}}|{{{image|}}}|{{PAGENAME}}}} GRN.webp|center|frameless]]
|RED
|-|YLW=[[File:{{#if: {{{image|}}}|{{{image|}}}|{{PAGENAME}}}} YLW.webp|center|frameless]]
|[[File:{{{image|{{PAGENAME}}}}} BLU.png|center|frameless|256px]]
</tabber>
|BLU
}}
|[[File:{{{image|{{PAGENAME}}}}} GRN.png|center|frameless|256px]]
|GRN
|[[File:{{{image|{{PAGENAME}}}}} YLW.png|center|frameless|256px]]
|YLW}}|{{#ifexist: File:{{{image|{{PAGENAME}}}}}.png |
{{!}}-
{{!}} class="infobox-image" colspan="2" {{!}}
[[File:{{{image|{{PAGENAME}}}}}.png|center|frameless|256px]]}}}}
|+
|+
! colspan="2" | Basic Information
! colspan="2" | Basic Information
{{#if: {{{class|}}} |
{{#if: {{{class|}}} |
{{!}}-
{{!}}-
{{!}} Icon {{!!}} [[File:{{{class|}}}.webp]]
{{!}} Icon {{!!}} [[File:{{{class}}}.png]]
}}
}}
{{#if: {{{type|}}} |
{{#if: {{{type|}}} |
{{!}}-
{{!}}-
{{!}} Type {{!!}} [[Classes#{{{type|}}}|{{{type|}}}]]
{{!}} Type {{!!}} [[Classes#{{{type}}}|{{{type}}}]]}}
}}
{{#if: {{{health|}}} |
{{#if: {{{health|}}} |
{{!}}-
{{!}}-
{{!}} Health {{!!}} {{{health|}}} {{#if: {{{overhealed|}}} | ({{{overhealed|}}} if overhealed)}}
{{!}} Health {{!!}} {{{health}}} {{#if: {{{overhealed|}}} | ({{{overhealed}}} with overheal)}}
}}
}}
{{#if: {{{speed|}}} |
{{#if: {{{speed|}}} |
{{!}}-
{{!}}-
{{!}} Speed {{!!}} {{{speed|}}}%
{{!}} Speed {{!!}} {{{speed}}}%
}}
}}
|}
|}
<noinclude>
[[Category:{{{title|{{PAGENAME}}}}}]]
Example usage:
[[Category:Classes]]
<pre>
{{#if: {{{type|}}} | [[Category:{{{type|}}} classes]]}} </includeonly>
{{Infobox class
<noinclude> <templatedata>
| title=Scout
{
| image=Scout
"params": {
| class=Leaderboard_class_scout
"title": {
| type=Offensive
"description": "Name of the class. (only use when it doesn't match page name)",
| health=125
"type": "string"
| overhealed=125
},
| speed=133
"image": {
}}
"description": "Prefix for the images of the class. (only use when it doesn't match page name)",
</pre>
"type": "wiki-file-name"
},
"class": {
"description": "Icon of the class.",
"type": "wiki-file-name",
"suggested": true
},
"type": {
"description": "Type of the class.",
"type": "string",
"suggested": true
},
"health": {
"description": "Health of the class.",
"type": "number",
"suggested": true
},
"overhealed": {
"description": "Health of the class, when overhealed.",
"type": "number",
"suggested": true
},
"speed": {
"description": "Speed of the class.",
"type": "number",
"suggested": true
}
},
"description": "Infobox for class pages."
}
</templatedata>
[[Category:Infobox]]
[[Category:Infobox]]
</noinclude>
</noinclude>

Latest revision as of 01:41, 3 September 2023

Infobox for class pages.

Template parameters

ParameterDescriptionTypeStatus
titletitle

Name of the class. (only use when it doesn't match page name)

Stringoptional
imageimage

Prefix for the images of the class. (only use when it doesn't match page name)

Fileoptional
classclass

Icon of the class.

Filesuggested
typetype

Type of the class.

Stringsuggested
healthhealth

Health of the class.

Numbersuggested
overhealedoverhealed

Health of the class, when overhealed.

Numbersuggested
speedspeed

Speed of the class.

Numbersuggested