From Dark and Darker Wiki
(added cobalt example) |
(Changed display to inline-flex) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><div class="iconbox" style="display:inline- | --><div class="iconbox" style="display:inline-flex;max-width:{{{maxwidth|initial}}}; flex-direction: column;align-items: center;flex-wrap: wrap;"><!-- | ||
ICON | ICON | ||
--><div class="rarity<!-- | --><div class="rarity<!-- | ||
Line 101: | Line 101: | ||
|<code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}}</nowiki></code> | |<code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}}</nowiki></code> | ||
|{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}} | |{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}} | ||
|- | |||
|<code><nowiki>{{Iconbox|Rubysilver Ore|size=30px|amount=5|top=Foobar}}</nowiki></code> | |||
|{{Iconbox|Rubysilver Ore|size=100x100px|amount=5|top=Foobar}} | |||
|} | |} | ||
Line 107: | Line 110: | ||
<code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}</nowiki></code> | <code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}</nowiki></code> | ||
{{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}} | {{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}Without max width:{{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it}} | ||
Revision as of 01:00, 20 February 2023
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|Weapons}}Accessing Weapons.png
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=no}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|top=Foobar}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|rarity=-1}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|nolink=1}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|size=x30px}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1}}
|
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}}
|
Foobar Arming Sword
|
{{Iconbox|Rubysilver Ore|size=30px|amount=5|top=Foobar}}
|
Other Options
The maxwidth
option lets you restrain text that would otherwise be very long:
{{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}
Without max width:
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, 5, 6, 7 | Number | suggested |
Size | size | Size with px to set width, eg. "30px" Size with xpx to set height, eg. "x30px" | 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 |