Template:Consumables: Difference between revisions

From PZwiki
No edit summary
(After all that work with the test template, I finally got the conditional tables working re: cooked/perishable)
Line 39: Line 39:
<!-- Table to use if the item is only perishable-->
<!-- Table to use if the item is only perishable-->
{{#ifexpr:{{{perishable|0}}}<>0| {{#ifexpr:{{{cookable|0}}}=0|
{{#ifexpr:{{{perishable|0}}}<>0| {{#ifexpr:{{{cookable|0}}}=0|
<TABLE class="wikitable" style="text-align: center;">
<TABLE class="wikitable" style="text-align: center; float:left; clear:left;">
   <TR>
   <TR>
     <TH colspan="4">Nutritional Information</TH>
     <TH colspan="4">Nutritional Information</TH>
Line 52: Line 52:
<!-- Table to use if the item only cookable-->
<!-- Table to use if the item only cookable-->
{{#ifexpr:{{{cookable|0}}}<>0| {{#ifexpr:{{{perishable|0}}}=0|
{{#ifexpr:{{{cookable|0}}}<>0| {{#ifexpr:{{{perishable|0}}}=0|
<TABLE class="wikitable" style="text-align: center;">
<TABLE class="wikitable" style="text-align: center; float:left; clear:left;">
   <TR>
   <TR>
     <TH colspan="4">Nutritional Information</TH>
     <TH colspan="4">Nutritional Information</TH>

Revision as of 09:40, 4 December 2013

Consumables


[[Image:{{{image}}}|120px]] Weight: unknown




Usage Example: Use this template to add an infobox to a consumable item's page. If a property is not included or is 0, it will not be displayed. Possible properties to add include:

Image [required]

perishable [true|false] (use 1 for true, 0 for false)

cookable [true|false] (use 1 for true, 0 for false)

weight, hunger, boredom, stress, unhappiness

cooked weight, cooked hunger, cooked boredom, cooked stress, cooked unhappiness

unrotten hunger, unrotten boredom, unrotten stress, unrotten unhappiness (Unrotten meaning not fresh anymore but not yet rotten)

unrottencooked weight, unrottencooked hunger, unrottencooked boredom, unrottencooked stress, unrottencooked unhappiness

rotten hunger, rotten boredom, rotten stress, rotten unhappiness

rottencooked weight, rottencooked hunger, rottencooked boredom, rottencooked stress, rottencooked unhappiness

code

Example usage in a page:

{{Consumables2 |name = Grapes |image = Item_Grapes.png |hunger = 0 |weight = 0.0 |perishable = 1 |rotten image = Item_GrapesRotten.png |rotten hunger = 0 }}