Jump to content

Template:Item Infobox: Difference between revisions

From The Petit Planet Wiki
Created page with "<includeonly><!-- --><infobox> <title source="name"> <format>{{#if:{{{number|}}}|<span class="number">{{{number}}} </span>}}{{{name|{{PAGENAME}}}}}</format> </title> <image source="image"> </image> <group layout="horizontal"> <data source="category"> <label>Category</label> <format>[[{{{category}}}]]</format> </data> <data source="type"> <label>Type</label> <format>[[{{{type}}}]]</format> </data> </group> <data sou..."
 
No edit summary
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly>{{#invoke:Infobox|main
--><infobox>
|kind = Item
   <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|<!--
  </image>
   -->{{#if:{{{number|}}}|<span class="archive-number">{{{number}}}</span>}}<!--
  <group layout="horizontal">
  -->{{{name|{{PAGENAME}}}}}<!--
    <data source="category">
-->}}}
      <label>Category</label>
|subtitle = {{{subtitle|}}}
      <format>[[{{{category}}}]]</format>
|image = {{#if:{{{image|}}}|[[File:{{{image|}}}]]|[[File:{{{title|{{{name|{{PAGENAME}}}}}}}} Icon.png]]}}
    </data>
|images = {{#if:{{{images|}}}|{{Array|{{{images}}}|;|[[File:²{#explode:{item}¦:¦0}²]]|,|template=1}}}}
    <data source="type">
|tabs = {{#if:{{{images|}}}|{{Array|{{{images}}}|;|²{#explode:{item}¦:¦1}²|,|template=1}}}}
      <label>Type</label>
|sections = Information, How to Obtain
      <format>[[{{{type}}}]]</format>
 
    </data>
|Information_collapsible = Yes
  </group>
|Information = Category, Type, Quality, Color, Strength, Effect, Collection Score, Selling Price
  <data source="quality">
|Category = {{#if:{{{category|}}}|[[{{{category}}}]]}}
    <label>Quality</label>
|Type = {{#if:{{{type|}}}|{{Array|{{{type}}}|;|[[{item}]]|,&nbsp;}}}}
    <format>{{{quality}}}</format>
|Type_label = Type{{#if:{{#explode:{{{type}}}|;|1}}|s}}
  </data>
|Quality = {{#if:{{{quality|}}}|<span class="quality-label">{{{quality}}}</span>}}
  <data source="size">
|Color = {{#if:{{{color|}}}|{{Array|{{{color}}}|;|[[{item}]]|,&nbsp;|sort=1}}}}
    <label>Size</label>
|Color_label = Color{{#if:{{#explode:{{{color}}}|;|1}}|s}}
    <format>{{{size}}}</format>
|Strength = {{#if:{{{strength|}}}|+{{{strength}}}}}
  </data>
|Effect = {{{effect|}}}
  <data source="sellPrice">
|Collection Score = {{#ifeq:{{{category|}}}|Crop|{{#switch:{{{quality|}}}|<!--
    <label>Sell Price</label>
-->|Gray|Common = +5<!--
  </data>
-->|Blue|Uncommon = +10<!--
  <header>How to Obtain</header>
-->|Purple|Rare = +15<!--
    <data source="source"><label>Obtain</label></data>
-->|Gold|Stellar = +30<!--
</infobox><!--
-->|#default = +?<!--
-->}}<!--
-->|{{{score|}}}}}
|Selling Price = {{#if:{{{sell|{{{price|}}}}}}|{{Item|Dough|20|x={{{sell|{{{price}}}}}}}}}}
 
|How to Obtain_collapsible = Yes
|How to Obtain = Source
|Source = {{#if:{{#explode:{{{source}}}|;|1}}|{{List|{{{source}}}}}|{{{source|}}}}}
|Source_label = Source{{#if:{{#explode:{{{source}}}|;|1}}|s}}
}}{{#if:{{{description|}}}|{{Description|{{{description}}}}}}}<!--
 
-->{{#invoke:Bucket|put|items
|+templateargs = name, number, quality, category, type, strength, source, effect, description, images
|page_id = {{PAGEID}}
|sell = {{{sell|{{{price|}}}}}}
|source-delimiter = ;
|image = {{{image|{{{title|{{{name|{{PAGENAME}}}}}}}} Icon.png}}}
|images-delimiter = ;
|removed = {{{removed|0}}}
}}<!--
 
-->{{Namespace|main=<!--
-->{{Namespace|main=<!--
-->[[Category:Materials]]<!--
-->[[Category:Items]]<!--
   Sort
   Sort
-->{{#if:{{{number|}}}|[[Category:Material|{{{number}}}]]|[[Category:Material]][[Category:Material Missing Number]]}}<!--
-->{{#if:{{{number|}}}|[[Category:Item|{{{number}}}]]|[[Category:Item]][[Category:Item Missing Number]]}}<!--
   Category
   Category
-->{{#if:{{{category|}}}|[[Category:{{{category}}}]]}}<!--
-->{{#if:{{{category|}}}|[[Category:{{{category}}}]]}}<!--
   Type
   Type
-->{{#if:{{{type|}}}|[[Category:{{{type}}} Material]]}}<!--
-->{{#if:{{{type|}}}|{{Array|{{{type}}}|;|[[Category:{item}]]}}|}}<!--
Quality
-->{{#if:{{{color|}}}|{{Cat List|{{{color}}}|{item} Items}}}}<!--
-->{{#switch:{{{quality}}}|Gray|Green|Purple|Gold=[[Category:{{{quality}}} Quality]]}}
  Quality
   {{#if:{{{quality|}}}|[[Category:Material by Quality|{{#switch:{{{quality|}}}
-->{{#switch:{{{quality}}}|Gray|Blue|Purple|Gold|Common|Uncommon|Rare|Stellar=[[Category:{{{quality}}} Quality]]}}
   |Gray       = 0
   {{#if:{{{quality|}}}|[[Category:Item by Quality|{{#switch:{{{quality|}}}
   |Green      = 1
   |Gray|Common    = 0
   |Purple     = 2
   |Blue|Uncommon    = 1
   |Gold       = 3
   |Purple|Rare  = 2
   |Gold|Stellar    = 3
   |#default = 4
   |#default = 4
   }}]]}}<!--
   }}]]}}<!--
  Set
-->{{#if:{{{set|}}}|[[Category:{{{set}}} Set Material]]}}<!--
  Size
-->{{#if:{{{size|}}}|[[Category:{{{size}}} Material]]}}<!--
-->}}<!--
-->}}<!--
--></includeonly><noinclude>{{Documentation|type=Infobox}}</noinclude>
--></includeonly><noinclude>{{Documentation|type=Infobox}}</noinclude>

Latest revision as of 16:06, 13 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 Items.

Syntax

[edit source]
{{Item Infobox
|name        = 
|category    = 
|type        = 
|quality     = 
|sell        = 
|description = 
|source      = 
}}
  • name – Name of the item.
  • category – Category of the item.
  • type – Type of the item.
  • quality – Quality of the item.
  • sell – Selling price of the item.
  • description – Description of the item.
  • source – Source(s) of the item as a semicolon separated list.

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]

{{Item Infobox
|name        = Wildgrass
|category    = Materials
|type        = Wildgrass
|quality     = Gray
|sell        = 1
|description = Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|source      = Example
}}
Wildgrass
Category
Quality
Gray
Selling Price
Dough Dough ×1
How to Obtain
Source
Example
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

{{Item Infobox
|name        = Example
|images      = Hexia Meadows Luca Fruit Icon.png:Icon; Hexia Meadows Preview.png:Preview
|category    = Example
|type        = Example
|quality     = Green
|sell        = 100
|description = Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|source      = Example; Example; Example
}}
Example
Icon
Preview
Category
Type
Quality
Green
Selling Price
Dough Dough ×100
How to Obtain
Sources
  • Example
  • Example
  • Example
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Template Data

[edit source]

Template that creates an infobox for items.

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
Namename

Name of the item.

Example
Wildgrass
Stringrequired
Numbernumber

Sorting number for the item.

Numbersuggested
Categorycategory

Category of the item.

Example
Materials
Stringsuggested
Typetype

Type of the item.

Example
Grass Color
Stringoptional
Qualityquality

Quality of the item.

Example
Gray, Purple, Gold
Stringsuggested
Selling pricesell price

Selling price of the item.

Example
1, 10, 20
Numberoptional
Descriptiondescription

Description of the item.

Contentsuggested
Sourcesource

Source(s) of the item as a semicolon separated list.

Example
Source 1; Source 2
Contentsuggested
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