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

Template:Weapon properties: Difference between revisions

Template page
Ratboy Slim (talk | contribs)
Made the font of the top header, "Properties", 22px, up from 20px
VivaRomania (talk | contribs)
mNo edit summary
 
Line 148: Line 148:
This is a template for displaying weapon properties on weapon pages.
This is a template for displaying weapon properties on weapon pages.


By default, the only rows that will show up are the "Properties" header row and the "All values are approximate" footer row.<br>
By default, the only rows that will show up are the "Properties" header row and the "All values are approximate" footer row.


To make a row appear in the template, pass any string to its parameter. If no parameter is passed, the row will not show up. The passed parameter will show up in its right-most column.<br>
To make a row appear in the template, pass any string to its parameter. If no parameter is passed, the row will not show up. The passed parameter will show up in its right-most column.


Values for header rows (Damage, Status Effects, Splash, Healing, Construction, Ammo, Function Times) must be <code>true</code> if you want them to be displayed. Any other value is silently ignored, and the header row will not appear.<br>
Values for header rows (Damage, Status Effects, Splash, Healing, Construction, Ammo, Function Times) must be {{code|true}} if you want them to be displayed. Any other value is silently ignored, and the header row will not appear.


Three-column parameters, such as <code>base-damage</code>, require an additional "percentage" parameter to be passed. The percentage parameter is named the same as the first one, but with <code>-percentage</code> at the end. For example, <code>base-damage-percentage</code>.<br>
Three-column parameters, such as {{code|base-damage}}, require an additional "percentage" parameter to be passed. The percentage parameter is named the same as the first one, but with {{code|-percentage}} at the end. For example, {{code|base-damage-percentage}}.


=== Editing this template ===
=== Editing this template ===
The basic principle is that the template is a MediaWiki table consisting of a series of rows. Each row is wrapped in an {{code|#if}} statement for each parameter name, which says that if a parameter with that name is given, that row appears and the parameter given is inserted into the row's rightmost column as a variable. This means more properties can be added to this template by copy and pasting the {{code|#if}} statement and adjusting the names. When adding properties to this template, also include them in the example table and syntax below.


The basic principle is that the template is a MediaWiki table consisting of a series of rows. Each row is wrapped in an <code>#if</code> statement for each parameter name, which says that if a parameter with that name is given, that row appears and the parameter given is inserted into the row's rightmost column as a variable. This means more properties can be added to this template by copy and pasting the <code>#if</code> statement and adjusting the names. When adding properties to this template, also include them in the example table and syntax below.
Rows with percentages have three columns instead of two, so copy and paste from those instead of any two-columned row. Do ''not'' include a default percentage, as this promotes lazy editing and can include inaccurate information. Headers use {{code|#ifeq}} statements instead of <code>#if</code> statements, so when adding a header, copy and paste the header code.


Rows with percentages have three columns instead of two, so copy and paste from those instead of any two-columned row. Do ''not'' include a default percentage, as this promotes lazy editing and can include inaccurate information. Headers use <code>#ifeq</code> statements instead of <code>#if</code> statements, so when adding a header, copy and paste the header code.
{{tl|!}}, {{tl|!!}}, and {{tl|!-}} are escape templates that represent {{code|{{!}}}}, {{code|{{!!}}}}, and {{code|{{!}}-}}, respectively. Their purpose is to escape those characters in templates that have tables, because MediaWiki syntax does not support a literal {{code|{{!}}}} symbol in templates that have tables.
 
{{tl|!}}, {{tl|!!}}, and {{tl|!-}} are escape templates that represent <code>|</code>, <code>||</code>, and <code>|-</code>, respectively. Their purpose is to escape those characters in templates that have tables, because MediaWiki syntax does not support a literal <code>|</code> symbol in templates that have tables.


See Wikipedia for more details: https://en.wikipedia.org/wiki/Help:Template#Creating_and_editing_templates
See Wikipedia for more details: https://en.wikipedia.org/wiki/Help:Template#Creating_and_editing_templates


=== Example Table ===
=== Example Table ===
The following is an example table with every parameter (currently) supported by the template.
The following is an example table with every parameter (currently) supported by the template.