Template:Infobox item: Difference between revisions

From Coral Island Wiki
Jump to navigation Jump to search
(Created page with "<includeonly><infobox> <title source="title"> <default>{{PAGENAME}}</default> </title> <image source="image"> <default>{{Exists|File:{{#titleparts:{{PAGENAME}}}}.png|{{#titleparts:{{PAGENAME}}}}.png|}}</default> <caption source="description" /> </image> <group> <header>Information</header> <data source="type"> <label>Type</label> <!-- Type shown in in-game details --> <format><!-- -->{{#switch:...")
 
(add formatnum)
 
(42 intermediate revisions by 2 users not shown)
Line 19: Line 19:
               -->|Resource<!-- crafting mat
               -->|Resource<!-- crafting mat
               -->|Resource equipment|Artisan equipment<!-- crafting
               -->|Resource equipment|Artisan equipment<!-- crafting
              -->|Artisan product<!-- artisan product
               -->|Animal product<!-- ranching
               -->|Animal product<!-- ranching
               -->|Scavengeable|Mushroom<!-- foraging
               -->|Scavengeable|Mushroom<!-- foraging
Line 32: Line 33:
               -->|Fish<!-- fishing
               -->|Fish<!-- fishing
               -->|Misc<!-- misc
               -->|Misc<!-- misc
               -->|Farming<!-- farming stuff
               -->|Farming|Ranch<!-- farming stuff
               -->|Decor<!-- farm decor
               -->|Decor<!-- farm decor
               -->|Cooking utensil<!-- cooking
               -->|Cooking utensil<!-- cooking
Line 40: Line 41:
         </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 56: Line 61:
           -->}}
           -->}}
         </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 69: Line 70:
         <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 81: Line 89:
         -->}}<!--
         -->}}<!--
         -->{{#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|{{{mastery|}}}}}<!--
               -->{{#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="produced_by">
        <label>Produced by</label>
        <format>{{Icon|{{{produced_by|}}}|note={{#if:{{{produced_note|}}}|{{{produced_note|}}}}}}}</format>
       </data>
       </data>
       <data source="source">
       <data source="source">
Line 96: Line 114:
       <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= {{formatnum:{{{sell|}}}}}
        }}</format>
       </data>
       </data>
       <data source="bronze">
       <data source="bronze">
         <label>{{q|1}}</label>
         <label>{{q|1}}</label>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|B|{{{sell|}}}}}}}</default>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|B|{{{sell|}}}}}}}</default>
        <format>{{formatnum:{{{bronze}}}}}</format>
       </data>
       </data>
       <data source="silver">
       <data source="silver">
         <label>{{q|2}}</label>
         <label>{{q|2}}</label>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|S|{{{sell|}}}}}}}</default>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|S|{{{sell|}}}}}}}</default>
        <format>{{formatnum:{{{silver}}}}}</format>
       </data>
       </data>
       <data source="gold">
       <data source="gold">
         <label>{{q|3}}</label>
         <label>{{q|3}}</label>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|G|{{{sell|}}}}}}}</default>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|G|{{{sell|}}}}}}}</default>
        <format>{{formatnum:{{{gold}}}}}</format>
       </data>
       </data>
       <data source="osmium">
       <data source="osmium">
         <label>{{q|4}}</label>
         <label>{{q|4}}</label>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|O|{{{sell|}}}}}}}</default>
         <default>{{#if:{{{diff_quality|}}}|{{Sell prices|O|{{{sell|}}}}}}}</default>
        <format>{{formatnum:{{{osmium}}}}}</format>
       </data>
       </data>
     </group>
     </group>
Line 166: Line 191:
       </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 186: Line 209:
         -->|{{Array|{{{season}}}|;|[[Category:{item} {{lc:{{{type}}}s}}]]}}<!--
         -->|{{Array|{{{season}}}|;|[[Category:{item} {{lc:{{{type}}}s}}]]}}<!--
       -->}}}}<!--
       -->}}}}<!--
   -->|Cooked dish<!-- food
  -->|Resource=<!-- crafting mat
       -->= [[Category:{{{type}}}es]]<!--
      -->[[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]]<!--
  -->|Scavengeable|Mushroom=<!-- foraging
      -->[[Category:Forageables]]<!--
      -->[[Category:{{{type}}}s]]<!--
      -->{{#if:{{{season|}}}|{{#ifeq:{{{season|}}}|Any<!--
        -->|[[Category:Any season forageables}}]]<!--
        -->|{{Array|{{{season}}}|;|[[Category:{item} forageables]]}}<!--
      -->}}}}<!--
   -->|Bomb|Decoy<!-- combat
   -->|Bomb|Decoy<!-- combat
  -->|Resource<!-- crafting mat
   -->|Resource equipment|Artisan equipment<!-- crafting
   -->|Resource equipment|Artisan equipment<!-- crafting
  -->|Artisan product<!-- artisan product
   -->|Animal product<!-- ranching
   -->|Animal product<!-- ranching
  -->|Scavengeable|Mushroom<!-- foraging
   -->|Bug<!-- land catcheables
   -->|Bug<!-- land catcheables
   -->|Ocean critter<!-- ocean catcheables
   -->|Ocean critter<!-- ocean catcheables
Line 207: Line 243:
   -->|Fish<!-- fishing
   -->|Fish<!-- fishing
   -->|Misc<!-- misc
   -->|Misc<!-- misc
   -->|Farming<!-- farming stuff
   -->|Farming|Ranch<!-- farming stuff
   -->|Decor<!-- farm decor
   -->|Decor<!-- farm decor
  -->|Others<!--
       -->= [[Category:{{{type}}}]]<!--
       -->= [[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:{{{produced_by|}}}|<!--
  -->{{#switch:{{{produced_by}}}<!--
      -->|Chicken|Duck|Peafowl|Quail = [[Category:{{{produced_by}}} products]][[Category:Coop products]]<!--
      -->|Pig|Luwak|Goat|Cow|Llama|Sheep = [[Category:{{{produced_by}}} products]][[Category:Barn products]]<!--
      -->|#default = [[Category:{{{produced_by}}} products]]<!--
  -->}}<!--
-->}}<!--
-->{{#ifeq:{{{produced_note|}}}|winner|[[Category:Golden animal products]]}}<!--
   Categories<!--
-->{{#if:{{{category|}}}|{{Array|{{{category|}}}|;|[[Category:{item}]]}}}}<!--
-->{{#if:{{{category|}}}|{{Array|{{{category|}}}|;|[[Category:{item}]]}}}}<!--
-->{{#if:{{{item_group|}}}|{{Array|{{{item_group}}}|;|[[Category:{item}s]]}}}}<!--
-->{{#if:{{{regrowth|}}}|[[Category:Regrowing crops]]}}<!--
-->{{#if:{{{regrowth|}}}|[[Category:Regrowing crops]]}}<!--
-->{{#if:{{{rank|}}}|[[Category:Town rank {{{rank}}}]]}}<!--
-->{{#if:{{{rank|}}}|[[Category:Town rank {{{rank}}}]]}}<!--
Line 219: Line 278:
-->{{#if:{{{wild_seed|}}}|[[Category:Crops from wild seeds]]}}<!--
-->{{#if:{{{wild_seed|}}}|[[Category:Crops from wild seeds]]}}<!--
-->{{#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
Line 225: Line 292:


Examples
Examples
--><noinclude>{{Documentation|type=Infobox}}</noinclude>
--><noinclude>{{Documentation|Type=Infobox}}</noinclude>

Latest revision as of 05:21, 21 April 2024

Documentation icon Template documentation
Note: parts of or the entire template might not be visible without values provided.

Example 1

Example 2

Example 3