From Brotato Wiki
(Docs: minor cleanup of examples (restructured into a table)) |
(Update template data to include "dlcbadge" (and "nolink", as that needed doing too)) |
||
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div class="iconbox" style="display:inline-block;width:{{{ | <includeonly><!-- | ||
--><div class="iconbox" style="display:inline-block;{{#if:{{{maxwidth|}}}|max-width:{{{maxwidth}}}|max-width:initial;}}"><!-- | |||
ICON | |||
--><div class="rarity<!-- | |||
-->{{#ifeq:{{{rarity|}}}|auto|{{GetRarity|{{{name|{{{1|}}}}}}}}|{{{rarity|{{Rarity|{{{name|{{{1|}}}}}}}}}}}}}<!-- | |||
--> rounded relative"><!-- | |||
IMAGE | |||
-->{{#ifeq:{{{nolink|}}}|1|<!-- | |||
No image link: | |||
-->[[File:{{{image|{{{name|{{{1|}}}}}}}}}.png|{{{size|60px}}}]]|<!-- | |||
Has image link: | |||
-->[[File:{{{image|{{{name|{{{1|}}}}}}}}}.png|{{{size|60px}}}|link={{{name|{{{1|}}}}}}|{{{name|{{{1|}}}}}}]]<!-- | |||
-->}}<!-- | |||
AMOUNT | |||
-->{{#if:{{{amount|}}}|<!-- | |||
--><span class="iconamount">{{{amount}}}</span><!-- | |||
-->|}}<!-- | |||
--></div><!-- | |||
TOP | |||
-->{{#if:{{{top|}}}|<!-- | |||
-->{{#ifeq:{{{nobr}}}|1|<!--empty space (nobr)--> |<br>}}<!-- | |||
-->{{{top}}}<!-- | |||
-->|}}<!-- | |||
TEXT (CAPTION) | |||
-->{{#ifeq:{{{caption}}}|no|<!--no caption-->|<!-- | |||
-->{{#ifeq:{{{nobr}}}|1|<!--empty space (nobr)--> |<br>}}<!-- | |||
-->{{#ifeq:{{{nolink|}}}|1|<!-- | |||
LINK: No | |||
-->{{#if:{{{caption|}}}|<!-- | |||
CAPTION: Custom | |||
--><strong>{{{caption}}}</strong><!-- | |||
-->|<!-- | |||
CAPTION: Auto | |||
--><strong>{{{name|{{{1|}}}}}}</strong><!-- | |||
-->}}<!-- | |||
-->|<!-- | |||
LINK: Yes | |||
-->{{#if:{{{caption|}}}|<!-- | |||
CAPTION: Custom | |||
-->[[{{{name|{{{1|}}}}}}|<strong>{{{caption}}}</strong>]]<!-- | |||
-->|<!-- | |||
CAPTION: Auto | |||
-->[[{{{name|{{{1|}}}}}}|<strong>{{{name|{{{1|}}}}}}</strong>]]<!-- | |||
-->}}<!-- | |||
-->}}<!-- | |||
-->}}<!-- | |||
SHOW DLC BADGE? (only show if this has isdlc=1 in its template data) | |||
-->{{#ifeq:{{{dlcbadge}}}|1|<!-- | |||
-->{{#ifeq:{{GetDLCStatus|{{{name|{{{1|}}}}}}|isdlc}}|1|{{DLCBadge}}|}}<!-- | |||
-->|}}<!-- | |||
--></div><!-- | |||
--></includeonly><noinclude> | |||
==Usage== | ==Usage== | ||
Line 34: | Line 85: | ||
<br><code><nowiki>{{Iconbox|Acid|rarity=5}}</nowiki></code> | <br><code><nowiki>{{Iconbox|Acid|rarity=5}}</nowiki></code> | ||
|{{Iconbox|Acid|rarity=-1}} {{Iconbox|Acid|rarity=1}} {{Iconbox|Acid|rarity=2}} {{Iconbox|Acid|rarity=3}} {{Iconbox|Acid|rarity=4}} {{Iconbox|Acid|rarity=5}} | |{{Iconbox|Acid|rarity=-1}} {{Iconbox|Acid|rarity=1}} {{Iconbox|Acid|rarity=2}} {{Iconbox|Acid|rarity=3}} {{Iconbox|Acid|rarity=4}} {{Iconbox|Acid|rarity=5}} | ||
|- | |||
|<code><nowiki>{{Iconbox|Acid|rarity=auto}}</nowiki></code> | |||
|{{Iconbox|Acid|rarity=auto}} | |||
|- | |||
|<code><nowiki>{{Iconbox|Acid|nolink=1}}</nowiki></code> | |||
|{{Iconbox|Acid|nolink=1}} | |||
|- | |||
|<code><nowiki>{{Iconbox|Acid|image=Tree}}</nowiki></code> | |||
|{{Iconbox|Acid|image=Tree}} | |||
|- | |- | ||
|<code><nowiki>{{Iconbox|Acid|size=30px}}</nowiki></code> | |<code><nowiki>{{Iconbox|Acid|size=30px}}</nowiki></code> | ||
|{{Iconbox|Acid|size=30px}} | |{{Iconbox|Acid|size=30px}} | ||
|- | |||
|<code><nowiki>{{Iconbox|Acid|size=30px|nobr=1}}</nowiki></code> | |||
|{{Iconbox|Acid|size=30px|nobr=1}} | |||
|- | |||
|<code><nowiki>{{Iconbox|Acid|size=30px|nobr=1|top=Foobar}}</nowiki></code> | |||
|{{Iconbox|Acid|size=30px|nobr=1|top=Foobar}} | |||
|- | |||
|<code><nowiki>{{Iconbox|Acid|dlcbadge=1}}</nowiki></code> | |||
|{{Iconbox|Acid|dlcbadge=1}} | |||
|- | |||
|<code><nowiki>{{Iconbox|Anchor|dlcbadge=1}}</nowiki></code> | |||
|{{Iconbox|Anchor|dlcbadge=1}} | |||
|} | |} | ||
=== Other Options === | |||
The <code>maxwidth</code> option lets you restrain text that would otherwise be very long: | |||
<code><nowiki>{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}</nowiki></code> | |||
{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}} | |||
<templatedata> | |||
</noinclude> | { | ||
"params": { | |||
"maxwidth": { | |||
"label": "Max Width", | |||
"description": "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", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"rarity": { | |||
"label": "Rarity", | |||
"description": "Options: -1, 1, 2, 3, 4, auto", | |||
"type": "number", | |||
"suggested": true | |||
}, | |||
"name": { | |||
"aliases": [ | |||
"1" | |||
], | |||
"label": "Name", | |||
"description": "Name of the character/item/weapon", | |||
"type": "string", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"image": { | |||
"label": "Image Override", | |||
"description": "If not set, uses the image that matches the name", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"size": { | |||
"label": "Size", | |||
"description": "Size with px, eg. \"30px\"", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"amount": { | |||
"label": "Amount", | |||
"description": "Shows a number on the bottom right corner", | |||
"type": "number", | |||
"suggested": true | |||
}, | |||
"top": { | |||
"label": "Top Text", | |||
"description": "Shown above the caption", | |||
"suggested": true | |||
}, | |||
"nobr": { | |||
"label": "Prevent Line Breaks?", | |||
"description": "If enabled, removes the line break, putting the icon and text on a single line. Use 1 to enable", | |||
"type": "boolean", | |||
"suggested": true | |||
}, | |||
"caption": { | |||
"label": "Caption Override", | |||
"description": "If not set, uses the specified name. Always links to the name. Use \"no\" to hide the caption", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"nolink": { | |||
"label": "Disabling link the Text?", | |||
"type": "boolean", | |||
"suggested": true | |||
}, | |||
"dlcbadge": { | |||
"label": "Show DLC Badge?", | |||
"description": "Use 1 to enable showing the badge. Or - if not.", | |||
"type": "boolean", | |||
"suggested": true | |||
} | |||
}, | |||
"paramOrder": [ | |||
"name", | |||
"rarity", | |||
"size", | |||
"amount", | |||
"image", | |||
"caption", | |||
"top", | |||
"nobr", | |||
"maxwidth", | |||
"dlcbadge", | |||
"nolink" | |||
], | |||
"format": "inline" | |||
} | |||
</templatedata></noinclude> |
Latest revision as of 22:59, 10 November 2024
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}}
|
|
{{Iconbox|Acid|amount=1}}
|
|
{{Iconbox|Acid|caption=Foobar}}
|
|
{{Iconbox|Acid|caption=no}}
|
|
{{Iconbox|Acid|top=Foobar}}
|
|
{{Iconbox|Acid|rarity=-1}}
|
|
{{Iconbox|Acid|rarity=auto}}
|
|
{{Iconbox|Acid|nolink=1}}
|
|
{{Iconbox|Acid|image=Tree}}
|
|
{{Iconbox|Acid|size=30px}}
|
|
{{Iconbox|Acid|size=30px|nobr=1}}
|
|
{{Iconbox|Acid|size=30px|nobr=1|top=Foobar}}
|
Foobar Acid
|
{{Iconbox|Acid|dlcbadge=1}}
|
|
{{Iconbox|Anchor|dlcbadge=1}}
|
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}}
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Name | name 1 | Name of the character/item/weapon | String | required |
Rarity | rarity | Options: -1, 1, 2, 3, 4, auto | Number | suggested |
Size | size | Size with px, eg. "30px" | String | suggested |
Amount | amount | Shows a number on the bottom right corner | Number | suggested |
Image Override | image | If not set, uses the image that matches the name | String | suggested |
Caption Override | caption | If not set, uses the specified name. Always links to the name. Use "no" to hide the caption | String | suggested |
Top Text | top | Shown above the caption | Unknown | suggested |
Prevent Line Breaks? | nobr | If enabled, removes the line break, putting the icon and text on a single line. Use 1 to enable | Boolean | suggested |
Max Width | maxwidth | If set, constrains the box to the specified width. Accepts any valid CSS width (60px, 60%). If not set, uses max-width:initial.
| String | suggested |
Show DLC Badge? | dlcbadge | Use 1 to enable showing the badge. Or - if not. | Boolean | suggested |
Disabling link the Text? | nolink | no description | Boolean | suggested |