Template:Construction: Difference between revisions
m (Trying to diagnose the blank space) |
(Modified to use the Lua module) |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly>{{#invoke: Construction| renderTable | ||
| planks = {{{Planks| {{{1|}}} }}} | |||
| bricks = {{{Bricks| {{{2|}}} }}} | |||
{{# | | fabric = {{{Fabric| {{{3|}}} }}} | ||
| parts = {{{Parts| {{{4|}}} }}} | |||
}}</includeonly><noinclude> | |||
{{ | |||
== Overview == | == Overview == | ||
Line 54: | Line 48: | ||
(It's there, but it's a blank table.) | (It's there, but it's a blank table.) | ||
The template also does not prevent you from mixing both named and unnamed parameters, but the result will be | The template also does not prevent you from mixing both named and unnamed parameters, but the result will be whichever is defined last. | ||
<pre>{{Construction||10|Bricks=12}}</pre> | <pre>{{Construction||10|Bricks=12}}</pre> |
Revision as of 16:45, 28 November 2023
Overview
A template to populate small, well-aligned tables of construction goods.
Parameters
You may elect to name the parameters explicitly (Planks=
) or use them in the order specified in the table:
Parameter | Type | Description |
---|---|---|
Planks | Number | The number of Planks required. |
Bricks | Number | The number of Bricks required. |
Fabric | Number | The number of Fabric required. |
Parts | Number | The number of Parts required. |
Examples
This table shows all possible values. {{Construction|Planks=12|Bricks=8|Fabric=4|Parts=2}}
yields:
12 | Planks |
8 | Bricks |
4 | Fabric |
2 | Parts |
Alternatively, you do not have to name the parameters. {{Construction|12|8|4|2}
yields the same thing:
12 | Planks |
8 | Bricks |
4 | Fabric |
2 | Parts |
You can also mix naming and not-naming to make it easier to write when skipping over building materials. {{Construction|8|Parts=2}}
yields:
8 | Planks |
2 | Parts |
Errors
This template does not result in any errors. However, there is no use for a template called without parameters.
{{Construction}}
Yields:
(It's there, but it's a blank table.)
The template also does not prevent you from mixing both named and unnamed parameters, but the result will be whichever is defined last.
{{Construction||10|Bricks=12}}
Yields:
12 | Bricks |