From Dark and Darker Wiki
m (Adjusted the 'iconamount' span to not interact w/ the pointer. This allows the image to be clickable through the amount #. (Before it wouldn't work)) |
m (Removed unnecessary rarity check. Moved pipe character to beginning of then and else clauses. This brings it in line with the style used on other templates.) |
||
Line 2: | Line 2: | ||
--><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;"><!-- | --><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{{{rarity|5}}} rounded relative"><!-- | ||
IMAGE | IMAGE | ||
-->{{#ifeq:{{{nolink|}}}|1 | -->{{#ifeq:{{{nolink|}}}|1<!-- | ||
No image link: | No image link: | ||
-->[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}]] | -->|[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}]]<!-- | ||
Has image link: | |||
-->[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}|link={{{name|{{{1|}}}}}}|{{{name|{{{1|}}}}}}]] | -->|[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}|link={{{name|{{{1|}}}}}}|{{{name|{{{1|}}}}}}]]}}<!-- | ||
AMOUNT | AMOUNT | ||
-->{{#if:{{{amount|}}} | -->{{#if:{{{amount|}}}<!-- | ||
--><span class="iconamount" style="pointer-events:none">{{{amount}}}</span> | -->|<span class="iconamount" style="pointer-events:none">{{{amount}}}</span>}}</div><!-- | ||
TOP | TOP | ||
-->{{#if:{{{top|}}} | -->{{#if:{{{top|}}}<!-- | ||
-->{{{top}}} | -->|{{{top}}}}}<!-- | ||
CAPTION | CAPTION | ||
-->{{#ifeq:{{{caption}}}|no | -->{{#ifeq:{{{caption}}}|no<!-- | ||
-->{{#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 | ||
--><strong>{{{name|{{{1|}}}}}}</strong | -->|<strong>{{{name|{{{1|}}}}}}</strong>}}<!-- | ||
LINK: Yes | LINK: Yes | ||
-->{{#if:{{{caption|}}} | -->|{{#if:{{{caption|}}}<!-- | ||
CAPTION: Custom | CAPTION: Custom | ||
-->[[{{{name|{{{1|}}}}}}|<strong>{{{caption}}} </strong>]] | -->|[[{{{name|{{{1|}}}}}}|<strong>{{{caption}}} </strong>]]<!-- | ||
CAPTION: Auto | CAPTION: Auto | ||
-->[[{{{name|{{{1|}}}}}}|<strong>{{{name|{{{1|}}}}}}</strong>]] | -->|[[{{{name|{{{1|}}}}}}|<strong>{{{name|{{{1|}}}}}}</strong>]]}} }} }}</div><!-- | ||
--></includeonly><noinclude> | --></includeonly><noinclude> | ||
Line 109: | Line 95: | ||
<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}}Without max width:{{Iconbox|Arming Sword|image=Armingsword_1.png|size=60px|top=This text is quite long but maxwidth restrains it}} | {{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}} | ||
</noinclude> | |||
Revision as of 03:49, 22 March 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|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}}
|
FoobarArming Sword
|
{{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}}
|
FoobarArming Sword
|
{{Iconbox|Rubysilver Ore|size=30px|amount=5|top=Foobar}}
|
FoobarRubysilver Ore
|
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: