Template:Infobox item: Difference between revisions

From Coral Island Wiki
Jump to navigation Jump to search
(Copy Template:Infobox item from Fandom's CI Wiki)
No edit summary
Line 42: Line 42:
       <data source="category">
       <data source="category">
         <label>Item category</label> <!-- Gifting, and ingredient categories all in one -->
         <label>Item category</label> <!-- Gifting, and ingredient categories all in one -->
         <format>{{Array|{{{category|}}}|;|[[{item}]]|<br />}}</format>
         <format>{{#switch:{{#explode:{{{category|}}}|;|0}}<!--
        -->|Common gem |Uncommon gem |Rare gem |Super rare gem |Legendary gem<!--
        -->|Common artifact |Uncommon artifact |Rare artifact |Super rare artifact |Legendary artifact<!--
        -->|Common fossil |Uncommon fossil |Rare fossil |Super rare fossil |Legendary fossil = [[enchanting|{{#explode:{{{category|}}}|;|0}}]]{{#ifexpr:{{#rpos:{{{category|}}}|;}}>-1|<br />[[{{#explode:{{{category|}}}|;|1}}|{{#replace:{{#explode:{{{category|}}}|;|1}}| (group)}}]]}}<!--
        -->|#default={{Array|{{{category|}}}|;|[[{item}]]|<br />}}}}</format>
       </data>
       </data>
       <data source="journal">
       <data source="journal">
Line 81: Line 85:
         -->}}<!--
         -->}}<!--
         -->{{#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="source">
        <label>Source</label>
        <format>{{Array|{{{source|}}}|;|{item}|<hr />}}</format>
       </data>
       </data>
       <data source="effect">
       <data source="effect">
         <label>Effects</label>
         <label>Effects</label>
      </data>
      <data source="enchanting">
        <label>[[Enchanting]] value</label>
        <default><!--
        -->{{#switch:{{lc:{{{type|}}}}}<!--
        -->| artifact | gem | fossil ={{Enchanting value|{{{category|}}}}}  points<!--
        -->|#default =<!--
        -->}}<!--
    --></default>
       </data>
       </data>
    </group>
    <group row-items="2">
      <header>Sources</header>
      <data source = "source">
      <label>Buy from</label>
      <format>{{#if:{{#DPL:|category=Sells {{lc:{{#titleparts:{{PAGENAME}}}}}}}}|[[#Shop availability|Shop]]}}</format>
      </data>
      <data source = "source">
      <label>Get from</label>
      <format>{{#if:{{#DPL:|category=Contains {{lc:{{#titleparts:{{PAGENAME}}}}}}}}|[[#Container availability|Container]]}}</format>
      </data>     
      <data source = "source">
      <label>Receive from</label>
      <format>{{#if:{{#DPL:|category=Gives {{lc:{{#titleparts:{{PAGENAME}}}}}}}}|[[#Received gift|NPC]]}}</format>
      </data>     
      <data source = "source">
      <label>Reward from</label>
      <format>{{#if:{{#DPL:|category=Rewards {{lc:{{#titleparts:{{PAGENAME}}}}}}}}|[[#Reward availability|Activity]]}}</format>     
      </data>     
      <data source = "source">
      <label>Drop from</label>
      <format>{{#if:{{#DPL:|category=Drops {{lc:{{#titleparts:{{PAGENAME}}}}}}}}|[[#Loot availability|Monster]]}}</format>           
      </data>
      <data source="source">
        <label>Other</label>
        <format>{{Array|{{{source|}}}|;|{item}|<hr />}}</format>
      </data>     
     </group>
     </group>
     <group layout="horizontal">
     <group layout="horizontal">
Line 101: Line 137:
         <format>{{#switch:{{lc:{{{sell|}}}}}
         <format>{{#switch:{{lc:{{{sell|}}}}}
         | 0 = ''Unsellable''
         | 0 = ''Unsellable''
         | #default= {{#if:{{{diff_quality|}}}|{{{sell|}}}|{{g|{{{sell|}}}}}}}
         | #default= {{#if:{{{diff_quality|}}}|{{formatnum:{{{sell|}}}}}|{{g|{{{sell|}}}}}}}
         }}</format>
         }}</format>
       </data>
       </data>
Line 121: Line 157:
       </data>
       </data>
     </group>
     </group>
    <group layout="horizontal">
      <header>Sell prices with {{Skill|{{{income|}}}}}</header>
      <data source="income">
        <label>Base</label>
        <format><!--
        -->{{#if:{{{diff_quality|}}}|{{Sell prices|D|{{{sell|}}}|type={{{income|}}}}}|{{g|{{Sell prices|D|{{{sell|}}}|type={{{income|}}}}}}}}}<!--
        --></format>
      </data>
      <data source="bronze">
        <label>{{q|1}}</label>
        <default>{{#if:{{{diff_quality|}}}|{{Sell prices|B|{{{sell|}}}|type={{{income|}}}}}}}</default>
      </data>
      <data source="silver">
        <label>{{q|2}}</label>
        <default>{{#if:{{{diff_quality|}}}|{{Sell prices|S|{{{sell|}}}|type={{{income|}}}}}}}</default>
      </data>
      <data source="gold">
        <label>{{q|3}}</label>
        <default>{{#if:{{{diff_quality|}}}|{{Sell prices|G|{{{sell|}}}|type={{{income|}}}}}}}</default>
      </data>
      <data source="osmium">
        <label>{{q|4}}</label>
        <default>{{#if:{{{diff_quality|}}}|{{Sell prices|O|{{{sell|}}}|type={{{income|}}}}}}}</default>
      </data>
    </group>   
     <group layout="horizontal">
     <group layout="horizontal">
       <header>Restores</header>
       <header>Restores</header>
Line 184: Line 245:
         -->|{{Array|{{{season}}}|;|[[Category:{item} crops}}]]}}<!--
         -->|{{Array|{{{season}}}|;|[[Category:{item} crops}}]]}}<!--
       -->}}}}<!--
       -->}}}}<!--
  -->|Seed|Seedling=<!-- seeds
      <!--commenting off this section to check whether there's impact on seeds having their own page
       -->{{#ifeq:{{{type}}}|Seed|[[Category:Seeds]]|[[Category:Seedlings]]}}<!--
  |Seed|Seedling=<!-- seeds
       -->{{#if:{{{season|}}}|{{#ifeq:{{{season|}}}|Any<!--
       {{#ifeq:{{{type}}}|Seed|[[Category:Seeds]]|[[Category:Seedlings]]}}<!--
        -->|[[Category:Any season {{lc:{{{type}}}s}}]]<!--
       {{#if:{{{season|}}}|{{#ifeq:{{{season|}}}|Any<!--
        -->|{{Array|{{{season}}}|;|[[Category:{item} {{lc:{{{type}}}s}}]]}}<!--
      |[[Category:Any season {{lc:{{{type}}}s}}]]<!--
       -->}}}}<!--
      |{{Array|{{{season}}}|;|[[Category:{item} {{lc:{{{type}}}s}}]]}}<!--
       }}}}<!--
   -->|Cooked dish<!-- food
   -->|Cooked dish<!-- food
       -->= [[Category:{{{type}}}es]]<!--
       -->= [[Category:{{{type}}}es]]<!--
Line 215: Line 277:
       -->= [[Category:{{{type}}}]]<!--
       -->= [[Category:{{{type}}}]]<!--
-->}}<!--
-->}}<!--
   Categories
   Categories<!--
-->{{#if:{{{id|}}}|[[Category:Item|{{{id}}}]]|[[Category:Item]][[Category:Item missing ID]]}}<!--
-->{{#if:{{{category|}}}|{{Array|{{{category|}}}|;|[[Category:{item}]]}}}}<!--
-->{{#if:{{{category|}}}|{{Array|{{{category|}}}|;|[[Category:{item}]]}}}}<!--
-->{{#if:{{{regrowth|}}}|[[Category:Regrowing crops]]}}<!--
{{#if:{{{regrowth|}}}|[[Category:Regrowing crops]]}}<!--
-->{{#if:{{{rank|}}}|[[Category:Town rank {{{rank}}}]]}}<!--
-->{{#if:{{{rank|}}}|[[Category:Town rank {{{rank}}}]]}}<!--
-->{{#if:{{{year|}}}|[[Category:Year {{{year}}}]]}}<!--
-->{{#if:{{{year|}}}|[[Category:Year {{{year}}}]]}}<!--
Line 224: Line 287:
-->{{#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 229: Line 300:


Examples
Examples
--><noinclude>{{Documentation|type=Infobox}}</noinclude>
--><noinclude>{{Documentation|content=
==Example 1==
{{T|Infobox item/Draft
|p1 =mastery      = Diving;7
|p2 =type         = Animal product
|p3 =category    = 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/Draft
|p1 =type        = Animal product
|p2 =category    = 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 13:12, 16 January 2024

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

Example 1

{{Infobox item/Draft
|mastery      = Diving;7
|type         = Animal product
|category     = 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/Draft
|type         = Animal product
|category     = 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
}}