Difference between revisions of "Template:Recipes"

From Stardew Valley Wiki
Jump to navigation Jump to search
(buff duration title to match infoboxes)
(Replace arrays)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><!--
+
<onlyinclude>{{#switch: {{lc:{{{1}}}}}
-->{{#arraydefine:values|image,name,description,ingredients,energy,health,buff,duration,recipe,sellprice|,}}<!--
 
-->{{#arraydefine:valuesToHide|{{{hide|}}}|,}}<!--
 
-->{{#arraydiff:valuesToShow|values|valuesToHide}}
 
{{#switch: {{lc:{{{1}}}}}
 
 
|foot|footer=
 
|foot|footer=
 
{{!}}-
 
{{!}}-
Line 9: Line 5:
 
|head
 
|head
 
|header=
 
|header=
{{{!}} class="wikitable sortable" id="roundedborder"
+
{{{!}} class="wikitable sortable roundedborder"
{{#arrayprint:valuesToShow|!|@@@@|
+
{{!}}-
  {{#switch:@@@@
+
!class="unsortable"{{!}}Image
    |image=!class="unsortable"{{!}}Image
+
!Name<!--
    |buff=!Buff(s)
+
-->{{#if:{{#pos:{{{hide|}}}|description}}||!!Description}}<!--
    |duration=!Buff Duration
+
-->{{#if:{{#pos:{{{hide|}}}|ingredients}}||!!Ingredients}}<!--
    |recipe=!Recipe Source(s)
+
-->{{#if:{{#pos:{{{hide|}}}|restores}}||!!Energy&nbsp;/ Health}}<!--
    |sellprice=!Sell Price
+
-->{{#if:{{#pos:{{{hide|}}}|buff}}||!!Buff(s)}}<!--
    |#default=!{{ucfirst:@@@@}}
+
-->{{#if:{{#pos:{{{hide|}}}|duration}}||!!Buff Duration}}<!--
  }}
+
-->{{#if:{{#pos:{{{hide|}}}|recipe}}||!!Recipe Source(s)}}<!--
}}
+
-->{{#if:{{#pos:{{{hide|}}}|sellprice}}||!!Sell Price}}
 
}}</onlyinclude><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>
 
}}</onlyinclude><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>

Latest revision as of 01:55, 17 September 2023

Description

This template provides the common Table-Header (and a closing footer) for Recipes. It is intended to be used in conjunction with Template:RecipeRow, which requires transclusion tags on each page to be transcluded.

For more information on transclusion tags, please see https://www.mediawiki.org/wiki/Transclusion

Header:

{| class="wikitable sortable"
!Image
!Name
!Description
!Ingredients
!Restores
!Buff(s)
!Buff(s) Duration
!Recipe Source(s)
!Sell Price

Use

This template can be used by entering the following onto a relevant page.

{{Recipes|header or footer}}

Example

{{Recipes|header}}
{{:Fried Mushroom|RecipeRow}}
{{Recipes|footer}}
Image Name Description Ingredients Energy / Health Buff(s) Buff Duration Recipe Source(s) Sell Price
Fried Mushroom.png
Fried Mushroom Earthy and aromatic. Common Mushroom.png Common Mushroom (1)Morel.png Morel (1)Oil.png Oil (1) Energy.png 135
Health.png 60
Attack.png Attack (+2) Time Icon.png 7m

Demetrius Icon.png Demetrius (Mail - 3+ HeartIconLarge.png)

data-sort-value="200">Gold.png200g