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 12: Line 12:
 
|class = <file-class>
 
|class = <file-class>
 
|tooltip = <default-tooltip-text>
 
|tooltip = <default-tooltip-text>
|tooltip-title = <mb-tooltip-title>
+
|minetip-title = <mb-minetip-title>
|tooltip-text = <mb-tooltip-text>
+
|minetip-text = <mb-minetip-text>
 
}}
 
}}
</nowiki></pre>. Note tht <code>tooltip-title</code> and <code>tooltip-text</code> are mandatory for the tooltip to work. In case you don't need <code>tooltip-text</code>, you can mention the parameter and leave it empty. <code>tooltip-title</code> defaults to the first parameter (<code>file-name</code>)'s text if it's not used.
+
</nowiki></pre>. Note tht <code>minetip-title</code> and <code>minetip-text</code> are mandatory for the tooltip to work. In case you don't need <code>minetip-text</code>, you can mention the parameter and leave it empty. <code>minetip-title</code> defaults to the first parameter (<code>file-name</code>)'s text if it's not used.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 27: Line 27:
 
| It's the item's name. It's mainly used for the image name. No format is needed to specify.
 
| It's the item's name. It's mainly used for the image name. No format is needed to specify.
 
| String
 
| String
| Invisible-sprite
+
| <code>Invisible-sprite</code>
 
| Recommended
 
| Recommended
 
|-
 
|-
Line 39: Line 39:
 
| Icon's size (both width and height share the same value to keep the image fully squared).
 
| Icon's size (both width and height share the same value to keep the image fully squared).
 
| Integer
 
| Integer
| 16
+
| <code>16</code>
 
| Optional
 
| Optional
 
|-
 
|-
Line 54: Line 54:
 
| Optional
 
| Optional
 
|-
 
|-
! <code>tooltip-title</code>
+
! <code>minetip-title</code>
 
| Icon's Mine Block tooltip title.
 
| Icon's Mine Block tooltip title.
 
| String
 
| String
Line 60: Line 60:
 
| Optional
 
| Optional
 
|-
 
|-
! <code>tooltip-text</code>
+
! <code>minetip-text</code>
 
| Icon's Mine Block tooltip text. Use the forward slash (<code>/</code>) as line breaks.
 
| Icon's Mine Block tooltip text. Use the forward slash (<code>/</code>) as line breaks.
 
| String
 
| String
 
| None
 
| None
| Optional.<br>Mandatory if <code>tooltip-title</code> is being used
+
| Optional.<br>Mandatory if <code>minetip-title</code> is being used
 
|}
 
|}
  
Line 73: Line 73:
 
* Name, link, size, and icon class: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class}}
 
* Name, link, size, and icon class: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class}}
 
* Name, link, size, icon class, and default tooltip text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.}}
 
* Name, link, size, icon class, and default tooltip text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.}}
* Name, link, size, icon class, default tooltip text, and empty mb tooltip title: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-title=}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-title=}}
+
* Name, link, size, icon class, default tooltip text, and empty mb tooltip title: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=}}
* Name, link, size, icon class, default tooltip text, and mb tooltip title with custom text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-title=Lorem ipsum}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-title=Lorem ipsum}}
+
* Name, link, size, icon class, default tooltip text, and mb tooltip title with custom text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=Lorem ipsum}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=Lorem ipsum}}
* Name, link, size, icon class, default tooltip text, and empty mb tooltip text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-text=}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-text=}}
+
* Name, link, size, icon class, default tooltip text, and empty mb tooltip text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-text=}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-text=}}
* Name, link, size, icon class, default tooltip text, and mb tooltip with custom text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-text=Dolor sit amet.}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-text=Dolor sit amet.}}
+
* Name, link, size, icon class, default tooltip text, and mb tooltip with custom text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-text=Dolor sit amet.}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-text=Dolor sit amet.}}
* Name, link, size, icon class, default tooltip text, mb tooltip title with custom text, and mb tooltip with custom text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-title=Lorem ipsum|tooltip-text=Dolor sit amet.}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|tooltip-title=Lorem ipsum|tooltip-text=Dolor sit amet.}}
+
* Name, link, size, icon class, default tooltip text, mb tooltip title with custom text, and mb tooltip with custom text: <code><nowiki>{{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=Lorem ipsum|minetip-text=Dolor sit amet.}}</nowiki></code> → {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=Lorem ipsum|minetip-text=Dolor sit amet.}}
  
 
== Note ==
 
== Note ==
 
Despite the default tooltip being removed if the custom mb tooltip is being used, it's recommended to also use it since it will display as a fallback in case the user has disabled their JavaScript.
 
Despite the default tooltip being removed if the custom mb tooltip is being used, it's recommended to also use it since it will display as a fallback in case the user has disabled their JavaScript.
 
</noinclude>
 
</noinclude>

Revision as of 12:37, 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>
|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 tht 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
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.
Mandatory if minetip-title is being used

Examples

  • Name: {{I-slot|name=Wooden Planks}}Wooden Planks
  • Name and link: {{I-slot|name=Wooden Planks|link=Cow}}Wooden Planks
  • Name, link, and size: {{I-slot|name=Wooden Planks|link=Cow|size=24}}Wooden Planks
  • Name, link, size, and icon class: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class}}Wooden Planks
  • Name, link, size, icon class, and default tooltip text: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.}}Default tooltip text.
  • Name, link, size, icon class, default tooltip text, and empty mb tooltip title: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=}}Default tooltip text.
  • Name, link, size, icon class, default tooltip text, and mb tooltip title with custom text: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=Lorem ipsum}}Default tooltip text.
  • Name, link, size, icon class, default tooltip text, and empty mb tooltip text: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-text=}}Default tooltip text.
  • Name, link, size, icon class, default tooltip text, and mb tooltip with custom text: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-text=Dolor sit amet.}}Default tooltip text.
  • Name, link, size, icon class, default tooltip text, mb tooltip title with custom text, and mb tooltip with custom text: {{I-slot|name=Wooden Planks|link=Cow|size=24|class=thumb-class|tooltip=Default tooltip text.|minetip-title=Lorem ipsum|minetip-text=Dolor sit amet.}}Default tooltip text.

Note

Despite the default tooltip being removed if the custom mb tooltip is being used, it's recommended to also use it since it will display as a fallback in case the user has disabled their JavaScript.