From Brotato Wiki

(Add support for rarity=auto)
(Re-apply the change for the wrapping element from <div> to <span>. This will stop them from breaking in the visual editor. (I will check for issues and keep this change if no issues are found))
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><div class="iconbox" style="display:inline-block;{{#if:{{{maxwidth|}}}|max-width:{{{maxwidth}}}|max-width:initial;}}"><!--
--><span class="iconbox" style="display:inline-block;{{#if:{{{maxwidth|}}}|max-width:{{{maxwidth}}}|max-width:initial;}}"><!--
ICON
ICON
--><div class="rarity<!--
--><div class="rarity<!--
Line 25: Line 25:
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
--></div><!--
--></span><!--
--></includeonly><noinclude>
--></includeonly><noinclude>



Revision as of 23:43, 9 November 2022


Usage

This template can be used by entering the following onto a relevant page. Do not use this on your user page. It is reserved for content pages.

{{Iconbox|Acid|size=30px|caption=caption|amount=1|rarity=1}}

Examples

Code Preview
{{Iconbox|Acid}}
Acid

Acid
{{Iconbox|Acid|amount=1}}
Acid1

Acid
{{Iconbox|Acid|caption=Foobar}}
Acid

Foobar
{{Iconbox|Acid|caption=no}}
Acid
{{Iconbox|Acid|top=Foobar}}
Acid

Foobar
Acid
{{Iconbox|Acid|rarity=-1}}


{{Iconbox|Acid|rarity=1}}
{{Iconbox|Acid|rarity=2}}
{{Iconbox|Acid|rarity=3}}
{{Iconbox|Acid|rarity=4}}
{{Iconbox|Acid|rarity=5}}

Acid

Acid
Acid

Acid
Acid

Acid
Acid

Acid
Acid

Acid
Acid

Acid
{{Iconbox|Acid|rarity=auto}}
Acid

Acid
{{Iconbox|Acid|size=30px}}
Acid

Acid
{{Iconbox|Acid|size=30px|nobr=1}}
Acid
  Acid
{{Iconbox|Acid|size=30px|nobr=1|top=Foobar}}
Acid
  Foobar  Acid

Other Options

The maxwidth option lets you restrain text that would otherwise be very long:

{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}

Acid

This text is quite long but maxwidth restrains it
Acid


No description.

Template parameters

ParameterDescriptionTypeStatus
Namename 1

Name of the character/item/weapon

Stringrequired
Rarityrarity

Options: -1, 1, 2, 3, 4, auto

Numbersuggested
Sizesize

Size with px, eg. "30px"

Stringsuggested
Amountamount

Shows a number on the bottom right corner

Numberoptional
Image Overrideimage

If not set, uses the image that matches the name

Stringsuggested
Caption Overridecaption

If not set, uses the specified name. Always links to the name. Use "no" to hide the caption

Stringsuggested
Top Texttop

Shown above the caption

Unknownsuggested
Prevent Line Breaks?nobr

If enabled, removes the line break, putting the icon and text on a single line. Use 1 to enable

Booleansuggested
Max Widthmaxwidth

If set, constrains the box to the specified width. Accepts any valid CSS width (60px, 60%). If not set, uses max-width:initial.

Example
60px
Stringsuggested