Difference between revisions of "Template:I-slot"

From Mine Blocks Wiki
Jump to navigation Jump to search
If you find a typo, inconsistency, or error, please sign up and help out the wiki! We can't do it without your help! :D Thank you!

 
Line 9: Line 9:
 
   | name = <file-name>
 
   | name = <file-name>
 
   | amount = <number>
 
   | amount = <number>
 +
  | durability = <number>
 
   | link = <item-link>
 
   | link = <item-link>
 
   | size = <file-size> (width and height at the same time)
 
   | size = <file-size> (width and height at the same time)
Line 21: Line 22:
  
 
<pre><nowiki>
 
<pre><nowiki>
{{I-slot|name= <file-name>|amount= <number>|link= <item-link>|size= <file-size> (width and height at the same time)|class= <file-class>|tooltip= <default-tooltip-text>|minetip-title= <mb-minetip-title>|minetip-text= <mb-minetip-text>}}
+
{{I-slot|name= <file-name>|amount= <number>|durability= <number>|link= <item-link>|size= <file-size> (width and height at the same time)|class= <file-class>|tooltip= <default-tooltip-text>|minetip-title= <mb-minetip-title>|minetip-text= <mb-minetip-text>}}
 
</nowiki></pre>
 
</nowiki></pre>
  
Line 119: Line 120:
 
}}
 
}}
 
|-
 
|-
| Name, amount and link
+
| Name, amount, and durability
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 125: Line 126:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 0
 +
}}
 +
</nowiki></pre>
 +
|
 +
{{I-slot
 +
  | name = Wooden Planks
 +
  | amount = 64
 +
  | durability = 0
 +
}}
 +
|-
 +
| Name, amount, durability and link
 +
|
 +
<pre><nowiki>
 +
{{I-slot
 +
  | name = Wooden Planks
 +
  | amount = 64
 +
  | durability = 10
 
   | link = Cow
 
   | link = Cow
 
}}
 
}}
Line 132: Line 150:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 10
 
   | link = Cow
 
   | link = Cow
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, and size
+
| Name, amount, durability, link, and size
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 141: Line 160:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 20
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 149: Line 169:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 20
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, and icon class
+
| Name, amount, durability, link, size, and icon class
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 159: Line 180:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 30
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 168: Line 190:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 30
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 173: Line 196:
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, icon class, and default tooltip text
+
| Name, amount, durability, link, size, icon class, and default tooltip text
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 179: Line 202:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 40
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 188: Line 212:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 40
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 194: Line 219:
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, icon class, default tooltip text, and empty mb tooltip title
+
| Name, amount, durability, link, size, icon class, default tooltip text, and empty mb tooltip title
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 200: Line 225:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 50
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 210: Line 236:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 50
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 217: Line 244:
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, icon class, default tooltip text, and mb tooltip title with custom text
+
| Name, amount, durability, link, size, icon class, default tooltip text, and mb tooltip title with custom text
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 223: Line 250:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 60
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 234: Line 262:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 60
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 241: Line 270:
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, icon class, default tooltip text, and empty mb tooltip text
+
| Name, amount, durability, link, size, icon class, default tooltip text, and empty mb tooltip text
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 247: Line 276:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 70
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 258: Line 288:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 70
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 265: Line 296:
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, icon class, default tooltip text, and mb tooltip with custom text
+
| Name, amount, durability, link, size, icon class, default tooltip text, and mb tooltip with custom text
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 271: Line 302:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 80
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 281: Line 313:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 80
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 288: Line 321:
 
}}
 
}}
 
|-
 
|-
| Name, amount, link, size, icon class, default tooltip text, mb tooltip title with custom text, and mb tooltip with custom text
+
| Name, amount, durability, link, size, icon class, default tooltip text, mb tooltip title with custom text, and mb tooltip with custom text
 
|
 
|
 
<pre><nowiki>
 
<pre><nowiki>
Line 294: Line 327:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 90
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 305: Line 339:
 
   | name = Wooden Planks
 
   | name = Wooden Planks
 
   | amount = 64
 
   | amount = 64
 +
  | durability = 90
 
   | link = Cow
 
   | link = Cow
 
   | size = 24
 
   | size = 24
Line 311: Line 346:
 
   | minetip-title = Lorem Ipsum
 
   | minetip-title = Lorem Ipsum
 
   | minetip-text = Dolor sit amet.
 
   | minetip-text = Dolor sit amet.
}}
 
{{I-slot
 
  | name = Wooden Planks
 
  | amount = 64
 
  | link = Cow
 
  | size = 24
 
  | class = thumb-class
 
  | tooltip = Default tooltip text.
 
  | minetip-title = Lorem Ipsum
 
  | minetip-text = Dolor sit amet.
 
  | durability = 50
 
 
}}
 
}}
 
|}
 
|}

Latest revision as of 19:10, 18 December 2021

{{{name}}}

About

This templated (named I-slot as a shortcut for item-slot) serves as an easy method to add icon sprites that are inside of a in-game slot, with tooltip included with the item's name and/or with extra info.

Usage

The syntax of the template is:

{{I-slot
  | name = <file-name>
  | amount = <number>
  | durability = <number>
  | link = <item-link>
  | size = <file-size> (width and height at the same time)
  | class = <file-class>
  | tooltip = <default-tooltip-text>
  | minetip-title = <mb-minetip-title>
  | minetip-text = <mb-minetip-text>
}}

The single line version is:

{{I-slot|name= <file-name>|amount= <number>|durability= <number>|link= <item-link>|size= <file-size> (width and height at the same time)|class= <file-class>|tooltip= <default-tooltip-text>|minetip-title= <mb-minetip-title>|minetip-text= <mb-minetip-text>}}

Note that minetip-title and minetip-text are mandatory for the tooltip to work. In case you don't need minetip-text, you can mention the parameter and leave it empty. minetip-title defaults to the first parameter (file-name)'s text if it's not used.

Parameter Function Value type Default value Status
name It's the item's name. It's mainly used for the image name. No format is needed to specify. String Invisible-sprite Recommended
amount Number of the same item. Integer None Optional
durability Amount of durability of the item, expressed in percentages multiples of 10. Integer None Optional
link Icon's link. Wikitext name's value Optional
size Icon's size (both width and height share the same value to keep the image fully squared). Integer 16 Optional
class Icon's extra classes. String None Optional
tooltip Icon's default tooltip text. It's automatically removed if the Mine Blocks-themed tooltip isbeing used (see below). String name's value Optional
minetip-title Icon's Mine Block tooltip title. String name's value Optional
minetip-text Icon's Mine Block tooltip text. Use the forward slash (/) as line breaks. String None Optional

Examples

Values used Code Result
Name
{{I-slot
  | name = Wooden Planks
}}

Wooden Planks

Name and amount
{{I-slot
  | name = Wooden Planks
  | amount = 64
}}

Wooden Planks64

Name, amount, and durability
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 0
}}

Wooden Planks64

Name, amount, durability and link
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 10
  | link = Cow
}}

Wooden Planks64

Name, amount, durability, link, and size
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 20
  | link = Cow
  | size = 24
}}

Wooden Planks64

Name, amount, durability, link, size, and icon class
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 30
  | link = Cow
  | size = 24
  | class = thumb-class
}}

Wooden Planks64

Name, amount, durability, link, size, icon class, and default tooltip text
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 40
  | link = Cow
  | size = 24
  | class = thumb-class
  | tooltip = Default tooltip text.
}}

Default tooltip text.64

Name, amount, durability, link, size, icon class, default tooltip text, and empty mb tooltip title
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 50
  | link = Cow
  | size = 24
  | class = thumb-class
  | tooltip = Default tooltip text.
  | minetip-title =
}}

Default tooltip text.64

Name, amount, durability, link, size, icon class, default tooltip text, and mb tooltip title with custom text
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 60
  | link = Cow
  | size = 24
  | class = thumb-class
  | tooltip = Default tooltip text.
  | minetip-title = Lorem Ipsum
}}

Default tooltip text.64

Name, amount, durability, link, size, icon class, default tooltip text, and empty mb tooltip text
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 70
  | link = Cow
  | size = 24
  | class = thumb-class
  | tooltip = Default tooltip text.
  | minetip-text =
}}

Default tooltip text.64

Name, amount, durability, link, size, icon class, default tooltip text, and mb tooltip with custom text
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 80
  | link = Cow
  | size = 24
  | class = thumb-class
  | tooltip = Default tooltip text.
  | minetip-text = Dolor sit amet.
}}

Default tooltip text.64

Name, amount, durability, link, size, icon class, default tooltip text, mb tooltip title with custom text, and mb tooltip with custom text
{{I-slot
  | name = Wooden Planks
  | amount = 64
  | durability = 90
  | link = Cow
  | size = 24
  | class = thumb-class
  | tooltip = Default tooltip text.
  | minetip-title = Lorem Ipsum
  | minetip-text = Dolor sit amet.
}}

Default tooltip text.64

Notes

  • If a custom value for the icons' size is going to be used, it should be any of these: 16, 18, 20, 22, or 24.
    • Using any other value will make the icon to not be centered.
    • Using a value higher than the ones mentioned above will make the icon overflow from its container box.
  • The values supported by the durability parameter are: 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100.
    • Any other value will make the durability bar empty.
  • Despite the default tooltip being removed if the custom mb tooltip is being used, it's recommended to not remove it (using the parameter but leaving its value empty) since it will display as a fallback in case the user has disabled their JavaScript.