Difference between revisions of "User:Kingerman88/Sandbox"
Jump to navigation
Jump to search
Kingerman88 (talk | contribs) |
Kingerman88 (talk | contribs) |
||
Line 57: | Line 57: | ||
== Template Mess == | == Template Mess == | ||
+ | <!-- | ||
{{#vardefine:name| {{{1|}}} }} | {{#vardefine:name| {{{1|}}} }} | ||
{{#vardefine:nCon| {{Q|{{{1|}}} |Real Hunger Rate}}}} | {{#vardefine:nCon| {{Q|{{{1|}}} |Real Hunger Rate}}}} | ||
+ | --> | ||
[[User:Kingerman88/Sandbox/AnimalTemplate]] | [[User:Kingerman88/Sandbox/AnimalTemplate]] |
Revision as of 16:14, 10 August 2021
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.43 | ||||
Cow | 0.43 | ||||
Pig | 0.4 |