Template:Crafting header: Difference between revisions

From PZwiki
(make tables sortable)
(Increase item limit from 9 to 10 (Pizza need 10 ingredients to make))
Line 200: Line 200:
   | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
   | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
   | #default = }}" {{!}} Ingredient 9
   | #default = }}" {{!}} Ingredient 9
| 10
| #default = ! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 1
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 2
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 3
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 4
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 5
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 6
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 7
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 8
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 9
! style="width:120px; {{#switch: {{{style|{{{type}}}}}}
  | medical|medicine|med = background-color:#{{Infobox nc|Medical}}; color:#{{Infobox nc|Medical|text}}
  | cooking|food = background-color:#{{Infobox nc|Food}}; color:#{{Infobox nc|Food|text}}
  | #default = }}" {{!}} Ingredient 10
}}
}}
{{#ifeq: true | {{{index}}} | ! style="width:50px" {{!}} Index | }}  
{{#ifeq: true | {{{index}}} | ! style="width:50px" {{!}} Index | }}  
|-</includeonly><noinclude>{{Documentation}}[[Category:Crafting templates]]</noinclude>
|-</includeonly><noinclude>{{Documentation}}[[Category:Crafting templates]]</noinclude>

Revision as of 13:29, 18 September 2022

[view] [edit] [history] [purge] Template documentation
This template is used to simplify the heading of crafting tables.

This will only 'open' the table, and will still need to be closed with |}.

Usage

The default design:

{{Crafting header}}
{{Crafting carpentry|001}}
|}
Produces:
Product XP Gained Skill(s) Recipe Ingredient 1 Ingredient 2 Ingredient 3 Ingredient 4 Ingredient 5 Ingredient 6 Ingredient 7 Ingredient 8 Ingredient 9 Ingredient 10
Plank.png
Plank x3
0.75 Carpentry
(0.25 above level 3)
none Handsaw.png
Saw (tag)
(keep)
Logs.png
Log
(consumed)








The 'index' set to "true":

{{Crafting header|index=true}}
{{Crafting carpentry|001}}|001
|}
Produces:
Product XP Gained Skill(s) Recipe Ingredient 1 Ingredient 2 Ingredient 3 Ingredient 4 Ingredient 5 Ingredient 6 Ingredient 7 Ingredient 8 Ingredient 9 Ingredient 10 Index
Plank.png
Plank x3
0.75 Carpentry
(0.25 above level 3)
none Handsaw.png
Saw (tag)
(keep)
Logs.png
Log
(consumed)






001


Custom number of ingredients:

{{Crafting header|ing=2}}
{{Crafting carpentry|001|ing=2}}
|}
Produces:
Product XP Gained Skill(s) Recipe Ingredient 1 Ingredient 2
Plank.png
Plank x3
0.75 Carpentry
(0.25 above level 3)
none Handsaw.png
Saw (tag)
(keep)
Logs.png
Log
(consumed)

Note that the ing argument needs to be defined for the table contents too.

Arguments

ing
The maximum number of ingredients to be used in the table.
index
Whether the index number column should be included.

See also

Documentation transcluded from Template:Crafting header/doc.
Editors can experiment in this template's sandbox (create)