User:Kingerman88/Sandbox
< User:Kingerman88
Jump to navigation
Jump to search
Revision as of 16:07, 10 August 2021 by Kingerman88 (talk | contribs) (Created page with " == Info Sheet == Variables: <code><nowiki> {{#vardefine:variableName| thing here }} </nowiki></code> <code><nowiki> Can be used via {{#var:name}} </nowiki></code> ──...")
Info Sheet
Variables:
{{#vardefine:variableName| thing here }}
Can be used via
{{#var:name}}
─────────────
Arguments:
They can be DEFINED in TEMPLATES
defined by three curly brackets and closed by three "{{{" argument "}}}"
{{{ 1 }}} (first argument)
{{{ 1| }}} (First argument or substitute argument "")
{{{ 1| default argument value}}} (First argument or substitute "default argument value")
Arguments can be defined as names
{{{ argName| defaultValue}}}
You can call them like this
{{template| argName=something | argName2=something}}
Keywords
Surround by {{ }}
Name | Description | Arguments | Example | Result |
---|---|---|---|---|
formatnum: | Formats the number | 1: number to be formatted | {{formatnum: 134512.5}} |
134,512.5 |
#expr | Represents an expression to do math on | 1: Expression to do | {{#expr:1.125*5 round 2}} |
5.63 |
#ifexpr | Simple if, else structure | 1: Condition | 2: True | 3: False | {{#ifexpr: {{#expr: 105 / 1}} > 100 | 100 | {{#expr: 105 / 1}} }} |
100 |
#switch: | Switch statement | {{#switch: {{{x}}} |1=one |2=two |3|4|5=range 3–5 |other}} |
(replace x with "2") two |
Template Mess
User:Kingerman88/Sandbox/AnimalTemplate
Animal | Nutrition Consumed (RHR / 2) |
---|---|
Boomalope | 0.86 |
Cow | Cow |