From Dark and Darker Wiki

(added width:max-content)
(removed <br> due to flex usage, added white-space: pre-wrap for flex)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><div class="iconbox" style="display:inline-flex;width:max-content;max-width:{{{maxwidth|initial}}}; flex-direction: column;align-items: center;flex-wrap: wrap;"><!--
--><div class="iconbox" style="display:inline-flex;width:max-content;max-width:{{{maxwidth|initial}}}; {{#ifeq:{{{nobr}}}|1||flex-direction: column;}}align-items: center;flex-wrap: wrap; white-space: pre-wrap;"><!--
ICON
ICON
--><div class="rarity<!--
--><div class="rarity<!--
Line 19: Line 19:
TOP
TOP
-->{{#if:{{{top|}}}|<!--
-->{{#if:{{{top|}}}|<!--
-->{{#ifeq:{{{nobr}}}|1|<!--empty space (nobr)-->&nbsp;&nbsp;|<br>}}<!--
-->{{{top}}}<!--
-->{{{top}}}<!--
-->|}}<!--
-->|}}<!--
CAPTION
CAPTION
-->{{#ifeq:{{{caption}}}|no|<!--no caption-->|<!--
-->{{#ifeq:{{{caption}}}|no|<!--no caption-->|<!--
-->{{#ifeq:{{{nobr}}}|1|<!--empty space (nobr)-->&nbsp;&nbsp;|<br>}}<!--
-->{{#ifeq:{{{nolink|}}}|1|<!--
-->{{#ifeq:{{{nolink|}}}|1|<!--
LINK: No
LINK: No
-->{{#if:{{{caption|}}}|<!--
-->{{#if:{{{caption|}}}|<!--
CAPTION: Custom
CAPTION: Custom
--><strong>{{{caption}}}</strong><!--
--><strong>{{{caption}}} </strong><!--
                     -->|<!--
                     -->|<!--
CAPTION: Auto
CAPTION: Auto
Line 38: Line 36:
-->{{#if:{{{caption|}}}|<!--
-->{{#if:{{{caption|}}}|<!--
CAPTION: Custom
CAPTION: Custom
-->[[{{{name|{{{1|}}}}}}|<strong>{{{caption}}}</strong>]]<!--
-->[[{{{name|{{{1|}}}}}}|<strong>{{{caption}}} </strong>]]<!--
                     -->|<!--
                     -->|<!--
CAPTION: Auto
CAPTION: Auto

Revision as of 01:12, 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}}
Arming Sword
{{Iconbox|Arming Sword|image=Armingsword_1.png|top=Foobar}}
{{Iconbox|Arming Sword|image=Armingsword_1.png|rarity=-1}}


{{Iconbox|Arming Sword|image=Arming Sword 0.png|rarity=0}}
{{Iconbox|Arming Sword|image=Arming Sword 1.png|rarity=1}}
{{Iconbox|Arming Sword|image=Arming Sword 2.png|rarity=2}}
{{Iconbox|Arming Sword|image=Arming Sword 3.png|rarity=3}}
{{Iconbox|Arming Sword|image=Arming Sword 4.png|rarity=4}}
{{Iconbox|Arming Sword|image=Arming Sword 5.png|rarity=5}}
{{Iconbox|Arming Sword|image=Arming Sword 6.png|rarity=6}}
{{Iconbox|Arming Sword|image=Arming Sword 7.png|rarity=7}}
{{Iconbox|Adventurer Boots Ruby Silver|image=Adventurer Boots Ruby Silver.png|rarity=Ruby Silver}}
{{Iconbox|Frock|image=Frock Cobalt.png|rarity=4}}

{{Iconbox|Arming Sword|image=Armingsword_1.png|nolink=1}}
Armingsword 1.png
Arming Sword
{{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}}
{{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}}

Arming Sword
This text is quite long but maxwidth restrains itArming Sword

Without max width:

Arming Sword
This text is quite long but maxwidth restrains itArming Sword


No description.

Template parameters

ParameterDescriptionTypeStatus
Namename 1

Name of the character/item/weapon

Stringrequired
Rarityrarity

Options: -1, 1, 2, 3, 4, 5, 6, 7

Numbersuggested
Sizesize

Size with px to set width, eg. "30px" Size with xpx to set height, eg. "x30px"

Stringsuggested
Amountamount

Shows a number on the bottom right corner

Numbersuggested
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