From Dark and Darker Wiki
No edit summary |
(Fix for link=nolink for Infobox.) |
||
(18 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><div class="iconbox" style="display:inline- | |||
--><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|-1}}} rounded relative"><!-- | ||
IMAGE | IMAGE | ||
-->{{#ifeq:{{{nolink|}}}|1| | -->{{#switch:1 | ||
|{{#if:{{{nolink|}}}{{#ifeq:{{{link|}}}|nolink|1}}|1}}= | |||
[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}|link=]] | |||
|{{#if:{{{link|}}}|1}}= | |||
[[File:{{{image|{{{name|{{{1|}}}}}}.png}}}|{{{size|60px}}}|link={{{link}}}]] | |||
|#default= | |||
[[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>}}</div><!-- | |||
TOP | TOP | ||
-->{{#if:{{{top|}}} | -->{{#if:{{{top|}}} | ||
|{{{top}}}}}<!-- | |||
CAPTION | CAPTION | ||
-->{{#ifeq:{{{caption}}}|no|<!-- | -->{{#switch:1 | ||
<!--If caption equals no, do nothing --> | |||
|{{#ifeq:{{{caption}}}|no|1}}=<!-- | |||
Elif nolink equals 1 AND caption exists, display caption in bold font --> | |||
|{{#ifeq:{{{nolink|}}}|1|{{#if:{{{caption|}}}|1}} }}= | |||
<strong>{{{caption}}}</strong><!-- | |||
Elif nolink equals 1, display name/first parameter in bold font --> | |||
|{{#ifeq:{{{nolink|}}}|1|1}}= | |||
<strong>{{{name|{{{1|}}}}}}</strong><!-- | |||
Elif link exists AND caption exists, display caption hyperlinked to link --> | |||
|{{#if:{{{link|}}}|{{#if:{{{caption|}}}|1}} }}= | |||
[[{{{link}}}|<strong>{{{caption}}} </strong>]]<!-- | |||
Elif link exists, display name/first parameter hyperlinked to link --> | |||
|{{#if:{{{link|}}}|1}}= | |||
[[{{{link}}}|<strong>{{{name|{{{1|}}}}}}</strong>]]<!-- | |||
Elif caption exists, display name/first parameter hyperlinked to caption --> | |||
|{{#if:{{{caption|}}}|1}}= | |||
[[{{{name|{{{1|}}}}}}|<strong>{{{caption}}} </strong>]]<!-- | |||
Else display name/first parameter hyperlinked to itself --> | |||
|#default= | |||
[[{{{name|{{{1|}}}}}}|<strong>{{{name|{{{1|}}}}}}</strong>]]}}</div><!-- | |||
--></includeonly><noinclude> | --></includeonly><noinclude> | ||
==Usage== | ==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. | 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. | ||
Line 54: | Line 48: | ||
==Examples== | ==Examples== | ||
<table class="wikitable"> | |||
<th> | |||
Code | |||
</th> | |||
<th> | |||
Preview | |||
</th> | |||
| | <tr> | ||
|<code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png}}</nowiki></code> | <td><code><nowiki>{{Iconbox|Weapons}}</nowiki>Accessing Weapons.png</code></td> | ||
|{{Iconbox|Arming Sword|image=Armingsword_1.png}} | <td>{{Iconbox|Weapons}}</td> | ||
| | </tr> | ||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar|link=Falchion}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar|link=Falchion}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar|link=Falchion|nolink=1}}</nowiki></code></td> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 0.png|rarity=0}}</nowiki></code> | <td>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar|link=Falchion|nolink=1}}</td> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 1.png|rarity=1}}</nowiki></code> | </tr> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 2.png|rarity=2}}</nowiki></code> | <tr> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 3.png|rarity=3}}</nowiki></code> | <td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar}}</nowiki></code></td> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 4.png|rarity=4}}</nowiki></code> | <td>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=Foobar}}</td> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 5.png|rarity=5}}</nowiki></code> | </tr> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 6.png|rarity=6}}</nowiki></code> | <tr> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 7.png|rarity=7}}</nowiki></code> | <td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=no}}</nowiki></code></td> | ||
|{{Iconbox|Arming Sword|image=Armingsword_1.png|rarity=-1}} {{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}} | <td>{{Iconbox|Arming Sword|image=Armingsword_1.png|caption=no}}</td> | ||
| | </tr> | ||
|<code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|nolink=1}}</nowiki></code> | <tr> | ||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|top=Foobar}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|top=Foobar}}</td> | |||
</tr> | |||
<tr> | |||
| | <td> | ||
|<code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1}}</nowiki></code> | <code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|rarity=-1}}</nowiki></code> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 0.png|rarity=0}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 1.png|rarity=1}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 2.png|rarity=2}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 3.png|rarity=3}}</nowiki></code> | |||
|} | <br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 4.png|rarity=4}}</nowiki></code> | ||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 5.png|rarity=5}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 6.png|rarity=6}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Arming Sword 7.png|rarity=7}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Arming Sword|image=Adventurer Boots Ruby Silver.png|rarity=Ruby Silver}}</nowiki></code> | |||
<br><code><nowiki>{{Iconbox|Frock|image=Frock Cobalt.png|rarity=4}}</nowiki></code> | |||
</td> | |||
<td> | |||
{{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|Arming Sword|image=Adventurer Boots Ruby Silver.png|rarity=Ruby Silver}} | |||
{{Iconbox|Frock|image=Frock Cobalt.png|rarity=4}} | |||
</td> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|nolink=1}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|nolink=1}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=x30px}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=x30px}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}}</nowiki></code></td> | |||
<td>{{Iconbox|Arming Sword|image=Armingsword_1.png|size=30px|nobr=1|top=Foobar}}</td> | |||
</tr> | |||
<tr> | |||
<td><code><nowiki>{{Iconbox|Rubysilver Ore|size=30px|amount=5|top=Foobar}}</nowiki></code></td> | |||
<td>{{Iconbox|Rubysilver Ore|size=30px|amount=5|top=Foobar}}</td> | |||
</tr> | |||
</table> | |||
=== Other Options === | === Other Options === | ||
Line 102: | Line 140: | ||
<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}} | ||
</noinclude> | |||
} | |||
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: