Jump to content

Template:Creature Infobox: Difference between revisions

From The Petit Planet Wiki
Rstar256 (talk | contribs)
mNo edit summary
ReisuDesign (talk | contribs)
No edit summary
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly>{{#invoke:Infobox|main
--><infobox>
|kind = Creature
   <title source="name">
|sep = ,
  <format>{{#if:{{{number|}}}|<span class="number">{{{number}}} </span>}}{{{name|{{PAGENAME}}}}}</format>
|class = quality-{{#if:{{{quality|}}}|{{lc:{{{quality}}}}}|none}}
  </title>
|title = <!--
  <image source="image"/>
-->{{{title|<!--
  <group layout="horizontal">
   -->{{#if:{{{number|}}}|<span class="archive-number">{{{number}}}</span>}}<!--
    <data source="category">
  -->{{{name|{{PAGENAME}}}}}<!--
      <label>Category</label>
-->}}}
      <format>[[{{{category}}}]]</format>
|subtitle = {{{subtitle|}}}
    </data>
|image = {{#if:{{{image|}}}|[[File:{{{image|}}}]]|[[File:{{{title|{{{name|{{PAGENAME}}}}}}}} Icon.png]]}}
    <data source="type">
|images = {{#if:{{{images|}}}|{{Array|{{{images}}}|;|[[File:²{#explode:{item}¦:¦0}²]]|,|template=1}}}}
      <label>Type</label>
|tabs = {{#if:{{{images|}}}|{{Array|{{{images}}}|;|²{#explode:{item}¦:¦1}²|,|template=1}}}}
      <format>[[{{{type}}}]]</format>
|sections = Checkbox, Information, Selling Prices
    </data>
 
  </group>
|Checkbox_nolabel = 1
  <data source="quality">
|Checkbox = Collected
    <label>Quality</label>
|Collected = Mark as collected <span class="tpt-instance wds-checkbox" data-category="{{PAGEID:Creature/List}}" data-pageid="{{PAGEID}}"></span>
    <format>{{{quality}}}</format>
 
  </data>
|Information_collapsible = Yes
  <data source="min_size">
|Information = Category, Group, Type, Quality, Size, Collection Score, Distribution, Habitat, Season, Active Time, Active Weather
    <label>Size</label>
|Category = {{#if:{{{category|}}}|[[{{{category}}}]]}}
    <format>{{{min_size}}} - {{{max_size}}} Li</format>
|Group = {{#if:{{{group|}}}|[[{{{group}}}]]}}
  </data>
|Type = {{#if:{{{type|}}}|[[{{{type}}}]]}}
  <data source="habitat">
|Quality = {{#if:{{{quality|}}}|{{#switch:{{{quality|}}}|Gray|Common= {{Common}}|Green|Blue|Uncommon = {{Uncommon}}|Purple|Rare = {{Rare}}|Gold|Yellow|Stellar = {{Stellar}}|Miracle= {{Miracle}}}}}}
    <label>Habitat</label>
|Size = {{{min_size|???}}} – {{{max_size|???}}} cm
    <format>{{{habitat}}}</format>
|Collection Score = {{#switch:{{{quality|}}}|<!--
  </data>
-->|Gray|Common = <ul><li>★ +5</li><li>★★ +13</li><li>★★★ +23</li></ul><!--
  <data source="distribution">
-->|Purple|Rare = <ul><li>★ +10</li><li>★★ +26</li><li>★★★ +46</li></ul><!--
    <label>Distribution</label>
-->|Gold|Stellar = <ul><li>★ +30</li><li>★★ +78</li><li>★★★ +138</li></ul><!--
    <format>{{#switch:{{{distribution|}}}|All Regions=All Regions|Exclusive to Islets=Exclusive to [[Islets]]|#default=[[{{{distribution}}}]]}}</format>
-->|#default = <ul><li>★ +?</li><li>★★ +?</li><li>★★★ +?</li></ul><!--
  </data>
-->}}
  <data source="time">
|Distribution = {{#if:{{{distribution|}}}|{{#switch:{{{distribution}}}|All Regions=All Regions|Exclusive to Islets=Exclusive to [[Islets]]|#default=[[{{{distribution}}}]]}}}}
    <label>Active Time</label>
|Habitat = {{{habitat|}}}
    <format>{{#switch:{{{time|}}}|All Day=All Day|#default=[[{{{time}}}]]}}</format>
|Season = {{#if:{{{season|}}}|{{Array|{{{season|}}}|;|[[{item}]]|,{space} }}}}
  </data>
|Active Time = {{#if:{{{time|}}}|{{#switch:{{{time}}}|All Day=All Day|#default=[[{{{time}}}]]}}}}
  <group layout="horizontal">
|Active Weather = {{#if:{{{weather|}}}|{{#switch:{{{weather}}}|Any Weather=Any Weather|#default=[[{{{weather}}}]]}}}}
    <data source="price1">
 
      <label>★</label>
|Selling Prices_collapsible = Yes
      <format>{{{price1}}}</format>
|Selling Prices_columns = 3
    </data>
|Selling Prices = ★, ★★, ★★★
    <data source="price2">
|★ = {{Item|Dough|x={{{sell1|{{{price1|?}}}}}}|notext=1}}
      <label>★★</label>
|★★ = {{Item|Dough|x={{{sell2|{{{price2|?}}}}}}|notext=1}}
      <format>{{{price2}}}</format>
|★★★ = {{Item|Dough|x={{{sell3|{{{price3|?}}}}}}|notext=1}}
    </data>
}}{{#if:{{{description|}}}|{{Description|{{{description}}}}}}}<!--
    <data source="price3">
 
      <label>★★★</label>
-->{{#invoke:Bucket|put|creatures
      <format>{{{price3}}}</format>
|+templateargs = name, number, quality, category, group, type, min_size, max_size, distribution, habitat, time, weather, images
    </data>
|page_id = {{PAGEID}}
  </group>
|folio_score = {{#switch:{{{quality|}}}|<!--
  <data source="description">
-->|Gray|Common = 5; 12; 22<!--
    <format>'''Description'''<br>{{{description}}}</format>
-->|Purple|Rare = 10; 24; 44<!--
  </data>
-->|Gold|Stellar = 40; 96; 176<!--
</infobox><!--
-->|#default = ?; ?; ?<!--
-->}}
|folio_score-delimiter = ;
|sell = {{{sell1|{{{price1|?}}}}}}; {{{sell2|{{{price2|?}}}}}}; {{{sell3|{{{price3|?}}}}}}
|sell-delimiter = ;
|image = {{{image|{{{title|{{{name|{{PAGENAME}}}}}}}} Icon.png}}}
|images-delimiter = ;
|description = {{#invoke:Feature|unstripNoWikiFrame|{{{description|}}}}}
|removed = {{{removed|0}}}
}}<!--
 
-->{{Namespace|main=<!--
-->{{Namespace|main=<!--
-->[[Category:Creatures]]<!--
-->[[Category:Creatures]]<!--
Sort
  Sort
-->{{#if:{{{number|}}}|[[Category:Creature|{{{number}}}]]|[[Category:Creature]][[Category:Creature Missing Number]]}}<!--
-->{{#if:{{{number|}}}|[[Category:Creature|{{{number}}}]]|[[Category:Creature]][[Category:Creature Missing Number]]}}<!--
Category
  Category
-->{{#switch:{{{category}}}|Shore-Dweller=[[Category:Shore-Dwellers]]|Insect=[[Category:Insects]]|[[Category:{{{category}}}]]}}<!--
-->{{#switch:{{{category}}}|Shore-Dweller=[[Category:Shore-Dwellers]]|Insect=[[Category:Insects]]|[[Category:{{{category}}}]]}}<!--
Type
  Group
-->{{#if:{{{group|}}}|[[Category:{{{group}}}]]}}<!--
  Type
-->{{#if:{{{type|}}}|[[Category:{{{type}}}]]}}<!--
-->{{#if:{{{type|}}}|[[Category:{{{type}}}]]}}<!--
Quality
  Quality
-->{{#switch:{{{quality}}}|Gray|Green|Purple|Gold=[[Category:{{{quality}}} Quality]]}}
-->{{#switch:{{{quality}}}|Gray|Green|Purple|Gold=[[Category:{{{quality}}} Quality]]}}
   {{#if:{{{quality|}}}|[[Category:Creature by Quality|{{#switch:{{{quality|}}}
   {{#if:{{{quality|}}}|[[Category:Creatures by Quality|{{#switch:{{{quality|}}}
   |Gray       = 0
   |Gray|Common        = 0
   |Green       = 1
   |Green|Blue|Uncommon = 1
   |Purple     = 2
   |Purple|Rare        = 2
   |Gold        = 3
   |Gold|Stellar       = 3
   |#default = 4
  |Miracle            = 4
   |#default           = 5
   }}]]}}<!--
   }}]]}}<!--
  Distribution
  Distribution
-->{{#if:{{{distribution|}}}|[[Category:{{{distribution}}} Creatures]]{{#if:{{{type|}}}|[[Category:{{{distribution}}} {{{type|}}}]]}}}}<!--
-->{{#if:{{{distribution|}}}|[[Category:{{{distribution}}} Creatures]]}}<!--
Time
-->{{#if:{{{time|}}}|[[Category:{{{time}}} Creatures]]}}<!--
-->{{#if:{{{time|}}}|[[Category:{{{time}}} Creatures]]{{#if:{{{type|}}}|[[Category:{{{time}}} {{{type|}}}]]}}}}<!--
-->{{#if:{{{season|}}}|{{Array|{{{season|}}}|;|[[Category:{item} Creatures]]}}}}<!--
-->{{#if:{{{weather|}}}|[[Category:{{{weather}}} Creatures]]}}<!--
-->}}<!--
-->}}<!--
--></includeonly><noinclude>{{Documentation|type=Infobox}}</noinclude>
--></includeonly><noinclude>{{Documentation|type=Infobox}}</noinclude>

Latest revision as of 15:37, 12 October 2026

Template documentation
Note: parts of or the entire template might not be visible without values provided.
This template uses Module:Infobox, a script written in Lua.
This template uses CSS found at MediaWiki:Gadget-Infobox.css.

Template that creates an infobox for Creatures.

Syntax

[edit source]
{{Creature Infobox
|name         = 
|number       = 
|category     = 
|group        = 
|type         = 
|quality      = 
|description  = 
|min_size     = 
|max_size     = 
|habitat      = 
|time         = 
|distribution = 
|weather      = 
|time         = 
|sell1        = 
|sell2        = 
|sell3        = 
}}
  • name – Name of the creature.
  • number – Zero-padded archive number of the creature.
  • category – Category of the creature.
  • group – Group of the creature.
  • type – Type of the creature.
  • quality – Quality of the creature.
  • description – Description of the creature.
  • min_size – Minimum size of the creature.
  • max_size – Maximum size of the creature.
  • distribution – Distribution of the creature.
  • habitat – Habitat of the creature.
  • time – Active time of the creature.
  • weather – Active weather of the creature.
  • sell1 – Selling price for a 1-star variant of the creature.
  • sell2 – Selling price for a 2-star variant of the creature.
  • sell3 – Selling price for a 3-star variant of the creature.

Other parameters

[edit source]
  • image – Override the default image with a single file. Default: name Icon.png.
  • images – Override the default image with multiple files and tabs.
    • Format: Image 1.ext:Tab 1 name; Image 2.ext:Tab 2 name; ... ; Image N.ext:Tab N name.

Example

[edit source]

{{Creature Infobox
|name         = Calico Koi
|number       = 001
|category     = Fish
|group        = Serene Waters of the Islets (Hexia)
|type         = Freshwater Fish
|quality      = Purple
|description  = Whether it actually brings good fortune or not depends on the definition of "good fortune."
|min_size     = 60.00
|max_size     = 86.00
|distribution = Exclusive to Islets
|habitat      = Lowland Lake
|time         = All Day
|weather      = Any Weather
|sell1        = 30
|sell2        = 33
|sell3        = ???
}}
001Calico Koi
Collected
Mark as collected
Category
Quality
Rare
Size
60.00 – 86.00 cm
Collection Score
  • ★ +10
  • ★★ +26
  • ★★★ +46
Distribution
Exclusive to Islets
Habitat
Lowland Lake
Active Time
All Day
Active Weather
Any Weather
Selling Prices
★
Dough×30
★★
Dough×33
★★★
Dough×???
Whether it actually brings good fortune or not depends on the definition of "good fortune."

Template Data

[edit source]

Template that creates an infobox for creatures.

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
Namename

Name of the creature.

Example
Calico Koi
Stringrequired
Numbernumber

Zero-padded archive number of the creature.

Example
001, 002, 003
Numbersuggested
Categorycategory

Category of the creature.

Example
Fish
Stringsuggested
Groupgroup

Group of the creature.

Example
Serene Waters of the Islets (Hexia)
Stringsuggested
Typetype

Type of the creature.

Example
Freshwater Fish
Stringsuggested
Qualityquality

Quality of the creature.

Example
Gray, Purple, Gold
Stringsuggested
Descriptiondescription

Description of the creature.

Contentsuggested
Minimum sizemin_size

Minimum size of the creature.

Example
60.00
Numbersuggested
Maximum sizemax_size

Maximum size of the creature.

Example
86.00
Numbersuggested
Distributiondistribution

Distribution of the creature.

Example
All Regions, Exclusive to Islets
Stringsuggested
Habitathabitat

Habitat of the creature.

Example
Lowland Lake
Stringsuggested
Active timetime

Active time of the creature.

Example
All Day, Daytime, Nighttime
Stringsuggested
Active weatherweather

Active weather of the creature.

Example
Any Weather, Rainy
Stringsuggested
Selling price 1sell1 price1

Selling price for a 1-star variant of the creature.

Example
10
Numbersuggested
Selling price 2sell2 price2

Selling price for a 2-star variant of the creature.

Example
15
Numbersuggested
Selling price 3sell3 price3

Selling price for a 3-star variant of the creature.

Example
20
Numbersuggested
Imageimage

Override the default image with a single file.

Default
<name> Icon.png
Example
Unknown Icon.png
Fileoptional
Imagesimages

Override the default image with multiple files and tabs.

Example
Image 1.ext:Tab 1 name; Image 2.ext:Tab 2 name
Contentoptional