Template:Infobox item/Draft: Difference between revisions

From Coral Island Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:
             -->{{#switch:{{{type}}}<!--
             -->{{#switch:{{{type}}}<!--
               -->|Vegetable|Fruit|Flower|Herb|Grain<!-- crops
               -->|Vegetable|Fruit|Flower|Herb|Grain<!-- crops
               -->|Seed|Seedling<!--seeds
               -->|Seed|Seedling<!-- seeds
              -->|Cooked dish<!-- food
               -->|Loot|Bomb|Decoy<!-- combat
               -->|Loot|Bomb|Decoy<!-- combat
               -->|Resource<!-- crafting mat
               -->|Resource<!-- crafting mat
Line 25: Line 26:
               -->|Geode|Gem<!-- mining
               -->|Geode|Gem<!-- mining
               -->|Letter|Torn page<!-- notes
               -->|Letter|Torn page<!-- notes
               -->|Tool|Weapon<!--  
               -->|Tool|Weapon<!-- tools
               -->|Consumable<!-- snacks
               -->|Consumable<!-- snacks
               -->|Bait<!-- fishing
               -->|Bait<!-- fishing
Line 31: Line 32:
               -->|Fish<!-- fishing
               -->|Fish<!-- fishing
               -->|Misc<!-- misc
               -->|Misc<!-- misc
               -->|Farming<!-- farming stuff
               -->|Farming|Ranch<!-- farming stuff
               -->|Decor<!-- farm decor
               -->|Decor<!-- farm decor
              -->|Cooking utensil<!-- cooking
                   --> = [[{{{type}}}]]<!--
                   --> = [[{{{type}}}]]<!--
               -->|#default = {{{type|}}}<!--
               -->|#default = {{{type|}}}<!--
Line 38: Line 40:
         </format>
         </format>
       </data>
       </data>
       <data source="category">
       <data source="item_group">
         <label>Item category</label> <!-- Gifting, and ingredient categories all in one -->
         <label>Item group</label> <!-- Gifting, and ingredient categories all in one -->
         <format>{{Array|{{{category|}}}|;|[[{item}]]|<br />}}</format>
         <format>{{Array|{{{item_group|}}}|;|[[{item}]]|<br />}}</format>
       </data>
       </data>
       <data source="journal">
       <data source="journal">
         <label>Journal category</label>
         <label>Journal category</label>
         <format>{{{journal|}}}</format> <!-- Journal side nav -->
         <format>{{{journal|}}}</format> <!-- Journal side nav -->
      </data>
      <data source="size">
        <label>Size</label>
        <format>{{{size|}}}</format>
       </data>
       </data>
       <data source="season">
       <data source="season">
Line 54: Line 60:
           -->}}
           -->}}
         </format>
         </format>
      </data>
      <data source="size">
        <label>Size</label>
        <format>{{{size|}}}</format>
       </data>
       </data>
       <data source="seed">
       <data source="seed">
         <label>Seed</label>
         <label>Seed</label>
         <format>{{Icon|{{{seed|}}}|note={{#if:{{{seed_price|}}}|{{g|{{{seed_price|}}}}}}}}}</format>
         <format>{{Icon|{{{seed|}}}|note={{#if:{{{seed_price|}}}|{{c|{{{seed_price|}}}}}}}}}</format>
       </data>
       </data>
       <data source="growth">
       <data source="growth">
Line 67: Line 69:
         <format><!--
         <format><!--
         -->{{{growth|}}} days<!--
         -->{{{growth|}}} days<!--
        -->{{#if:{{{growth_note|}}}|&nbsp;({{{growth_note|}}})}}<!--
         -->{{#if:{{{regrowth|}}}|<br />{{{regrowth|}}} {{#ifeq:{{{regrowth|}}}|1|day|days}} (regrowth)}}
         -->{{#if:{{{regrowth|}}}|<br />{{{regrowth|}}} {{#ifeq:{{{regrowth|}}}|1|day|days}} (regrowth)}}
         </format>
         </format>
      </data>
      <data source="giant_crop">
        <label>[[Crop#Giant crops|Giant crop]]</label>
      </data>
      <data source="wild_seed">
        <label>[[Wild seeds]]</label>
       </data>
       </data>
       <data>
       <data>
Line 79: Line 88:
         -->}}<!--
         -->}}<!--
         -->{{#if:{{{mastery|}}}|<!--
         -->{{#if:{{{mastery|}}}|<!--
             -->{{#switch:{{#explode:{{{mastery|}}}|;|0}}|Farming|Ranching|Foraging|Mining|Diving|<!--bug-->Catching|Fishing|Combat=<!--
             -->{{#switch:{{#explode:{{{mastery|}}}|;|0}}|Farming|Ranching|Foraging|Mining|Diving|<!--bug-->Catching|Fishing|Combat|0=<!--
               -->{{#if:{{{rank|}}}|<br />}}{{Mastery|{{#explode:{{{mastery|}}}|;|0}}|{{#explode:{{{mastery|}}}|;|1}}}}<!--
               -->{{#if:{{{rank|}}}|<br />}}{{Mastery|{{{mastery|}}}}}<!--
             -->}}<!--
             -->}}<!--
         -->}}<!--
         -->}}<!--
     --></default>
     --></default>
      </data>
      <data source="effect">
        <label>Effects</label>
      </data>
      <data source="enchanting">
        <label>[[Enchanting]] value</label>
      </data>
      <data source="animal">
        <label>Animal</label>
        <format>{{Icon|{{{animal|}}}}}</format>
      </data>
      <data source="animal">
        <label>Animal</label>
        <format>{{Icon|{{{animal|}}}}}</format>
       </data>
       </data>
       <data source="source">
       <data source="source">
Line 94: Line 117:
       <data source="sell">
       <data source="sell">
         <label>Base</label>
         <label>Base</label>
         <format>{{#if:{{{diff_quality|}}}|{{{sell|}}}|{{g|{{{sell|}}}}}}}</format>
         <format>{{#switch:{{lc:{{{sell|}}}}}
        | 0 = ''Unsellable''
        | #default= {{#if:{{{diff_quality|}}}|{{formatnum:{{{sell|}}}}}|{{c|{{{sell|}}}}}}}
        }}</format>
       </data>
       </data>
       <data source="bronze">
       <data source="bronze">
Line 164: Line 190:
       </data>
       </data>
     </group>
     </group>
    <data source="effect">
 
      <label>Effects</label>
    </data>
   </infobox><!--
   </infobox><!--
-->{{Namespace|main=<!--
-->{{Namespace|main=<!--
-->{{#ifeq:{{NAMESPACE}}||{{DISPLAYTITLE:{{{title|{{PAGENAME}}}}}|noreplace}}}}<!--
   Type
   Type
-->{{#switch:{{{type}}}<!--
-->{{#switch:{{{type}}}<!--
   -->|Vegetable|Fruit|Flower|Herb|Grain=<!-- crops
   -->|Vegetable|Fruit|Flower|Herb|Grain=<!-- crops
       -->[[Category:Crops]]<!--
       -->[[Category:Crops]]<!--
      -->[[Category:{{{type}}}s]]<!--
       -->{{#if:{{{season|}}}|{{#ifeq:{{{season|}}}|Any<!--
       -->{{#if:{{{season|}}}|{{#ifeq:{{{season|}}}|Any<!--
         -->|[[Category:Any season crops}}]]<!--
         -->|[[Category:Any season crops}}]]<!--
         -->|{{Array|{{{season}}}|;|[[Category:{item} crops}}]]}}<!--
         -->|{{Array|{{{season}}}|;|[[Category:{item} crops]]}}<!--
       -->}}}}<!--
       -->}}}}<!--
   -->|Seed|Seedling=<!-- seeds
   -->|Seed|Seedling=<!-- seeds
Line 184: Line 208:
         -->|{{Array|{{{season}}}|;|[[Category:{item} {{lc:{{{type}}}s}}]]}}<!--
         -->|{{Array|{{{season}}}|;|[[Category:{item} {{lc:{{{type}}}s}}]]}}<!--
       -->}}}}<!--
       -->}}}}<!--
  -->|Resource=<!-- crafting mat
      -->[[Category:Resources]]<!--
      -->{{#if:{{{seed}}}|[[Category:Crops]][[Category:Crop|{{{journal_id}}}]]}}<!--
      -->{{#if:{{{season|}}}|{{#ifeq:{{{season|}}}|Any<!--
        -->|[[Category:Any season crops}}]]<!--
        -->|{{Array|{{{season}}}|;|[[Category:{item} crops]]}}<!--
      -->}}}}<!--
  -->|Cooked dish<!-- food
      -->= [[Category:{{{type}}}es]]<!--
   -->|Bomb|Decoy<!-- combat
   -->|Bomb|Decoy<!-- combat
  -->|Resource<!-- crafting mat
   -->|Resource equipment|Artisan equipment<!-- crafting
   -->|Resource equipment|Artisan equipment<!-- crafting
   -->|Animal product<!-- ranching
   -->|Animal product<!-- ranching
Line 197: Line 229:
   -->|Consumable<!-- snacks
   -->|Consumable<!-- snacks
   -->|Bait<!-- fishing
   -->|Bait<!-- fishing
   -->|Trap=<!-- combat
   -->|Trap<!-- combat
       -->[[Category:{{{type}}}s]]<!--
  -->|Cooking utensil<!-- cooking
       -->= [[Category:{{{type}}}s]]<!--
   -->|Loot<!-- combat
   -->|Loot<!-- combat
   -->|Fish<!-- fishing
   -->|Fish<!-- fishing
   -->|Misc<!-- misc
   -->|Misc<!-- misc
   -->|Farming<!-- farming stuff
   -->|Farming|Ranch<!-- farming stuff
   -->|Decor=<!-- farm decor
   -->|Decor<!-- farm decor
       -->[[Category:{{{type}}}]]<!--
  -->|Others<!--
       -->= [[Category:{{{type}}}]]<!--
  -->|#default = [[Category:Pages with wrong input]]<!--
-->}}<!--
-->}}<!--
   Categories
  Seed type
-->{{#if:{{{seed|}}}|<!--
    -->{{If match|{{{seed|}}}<!--
        -->|seedlings?$<!--
        -->|saplings?$<!--
        -->|seeds?$<!--
        -->|true1=[[Category:Seedling crops]]<!--
        -->|true2=[[Category:Sapling crops]]<!--
        -->|true3=[[Category:Seed crops]]<!--
    -->}}<!--
-->}}<!--
  Animal products
-->{{#if:{{{animal|}}}|<!--
  -->{{#switch:{{{animal}}}<!--
      -->|Chicken|Duck|Peafowl|Quail = [[Category:{{{animal}}} products]][[Category:Coop products]]<!--
      -->|Pig|Luwak|Goat|Cow|Llama = [[Category:{{{animal}}} products]][[Category:Barn products]]<!--
  -->}}<!--
-->}}<!--
   Categories<!--
-->{{#if:{{{category|}}}|{{Array|{{{category|}}}|;|[[Category:{item}]]}}}}<!--
-->{{#if:{{{category|}}}|{{Array|{{{category|}}}|;|[[Category:{item}]]}}}}<!--
-->{{#if:{{{regrowth|}}}|[[Category:Regrowing crops]]}}<!--
-->{{#if:{{{regrowth|}}}|[[Category:Regrowing crops]]}}<!--
Line 215: Line 268:
-->{{#if:{{{health|}}}|[[Category:Consumables]][[Category:Edible ingredients]]}}<!--
-->{{#if:{{{health|}}}|[[Category:Consumables]][[Category:Edible ingredients]]}}<!--
-->}}<!--
-->}}<!--
  Sorting categories based on journal order
-->{{#switch:{{{type}}}<!--
  -->|Vegetable|Fruit|Flower|Herb|Grain= {{#if:{{{journal_id|}}}|[[Category:Crop|{{{journal_id}}}]]|[[Category:Crop]][[Category:Item missing sort ID]]}}<!--
  -->|Scavengeable|Mushroom= {{#if:{{{journal_id|}}}|[[Category:Scavengeable|{{{journal_id}}}]]|[[Category:Scavengeable]][[Category:Item missing sort ID]]}}<!--
  -->|Gem|Geode= {{#if:{{{journal_id|}}}|[[Category:Gem|{{{journal_id}}}]]|[[Category:Gem]][[Category:Item missing sort ID]]}}<!--
  -->|Animal product|Fish|Ocean critter|Artifact|Fossil|Letter|Torn page= {{#if:{{{journal_id|}}}|[[Category:{{{type}}}|{{{journal_id}}}]]|[[Category:{{{type}}}]][[Category:Item missing sort ID]]}}<!--
  -->|#default=<!--
  -->}}<!--
Necessary new line due to styling issues
Necessary new line due to styling issues
-->
-->
</includeonly><!--
</includeonly><!--
Examples
--><noinclude>{{Documentation|content=
==Example 1==
{{T|Infobox item
|p1 =mastery      = Diving;7
|p2 =type        = Animal product
|p3 =item_group  = Milk; Eggs
|p4 =journal      = Produce
|p5 =season      = Winter; Spring
|p6 =seed        = Apple sapling
|p7 =seed_price  = 20
|p8 =growth      = 9
|p9 =regrowth    = 3
|p10=giant_crop  = yes
|p11=wild_seed    = yes
|p12=rank        = B
|p13=year        = 2
|p14=building    = Coop;2
|p15=sell        = 100
|p16=health      = 40
|p17=energy      = 20
|p18=effect      = Drunk
|p19=source      = Foraging;Diving;Farming
|_Y_=1|block=1}}
{{clr}}
==Example 2==
{{T|Infobox item
|p1 =type        = Animal product
|p2 =item_group  = Milk; Eggs
|p3 =journal      = Produce
|p4 =season      = Winter; Spring
|p5 =seed        = Apple sapling
|p6 =seed_price  = 20
|p7 =growth      = 9
|p8 =regrowth    = 3
|p9 =giant_crop  = yes
|p10=wild_seed    = yes
|p11=rank        = B
|p12=year        = 2
|p13=building    = Coop;2
|p14=sell        = 100
|p15=health      = 40
|p16=energy      = 20
|p17=effect      = Drunk
|p18=diff_quality = 1
|_Y_=1|block=1}}
}}</noinclude>

Revision as of 09:06, 4 February 2024

225Asian Bookshelves.png
This is the template draft page for Template:Infobox item (diff).
Documentation icon Template documentation
Note: parts of or the entire template might not be visible without values provided.

Example 1

{{Infobox item
|mastery      = Diving;7
|type         = Animal product
|item_group   = Milk; Eggs
|journal      = Produce
|season       = Winter; Spring
|seed         = Apple sapling
|seed_price   = 20
|growth       = 9
|regrowth     = 3
|giant_crop   = yes
|wild_seed    = yes
|rank         = B
|year         = 2
|building     = Coop;2
|sell         = 100
|health       = 40
|energy       = 20
|effect       = Drunk
|source       = Foraging;Diving;Farming
}}

Example 2

{{Infobox item
|type         = Animal product
|item_group   = Milk; Eggs
|journal      = Produce
|season       = Winter; Spring
|seed         = Apple sapling
|seed_price   = 20
|growth       = 9
|regrowth     = 3
|giant_crop   = yes
|wild_seed    = yes
|rank         = B
|year         = 2
|building     = Coop;2
|sell         = 100
|health       = 40
|energy       = 20
|effect       = Drunk
|diff_quality = 1
}}