From Dark and Darker Wiki
(Changed nested if to a switch statement that emulates if, elif, else structure. Added capacity to control link behavior in both the caption and the image.) |
(Fix for link=nolink for Infobox.) |
||
Line 6: | Line 6: | ||
IMAGE | IMAGE | ||
-->{{#switch:1 | -->{{#switch:1 | ||
|{{#if:{{{nolink|}}}|1}}= | |{{#if:{{{nolink|}}}{{#ifeq:{{{link|}}}|nolink|1}}|1}}= | ||
[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}|link=]] | [[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}|link=]] | ||
|{{#if:{{{link|}}}|1}}= | |{{#if:{{{link|}}}|1}}= |
Latest revision as of 00:14, 15 August 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|link=Falchion}} |
|
{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar|link=Falchion|nolink=1}} |
Foobar |
{{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|nolink=1}} |
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}} |
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: