Please note that some information on this wiki is still based on the demo version.
If you notice any errors, feel free to correct them.
Template:ItemLink: Difference between revisions
From Super Fantasy Kingdom Official Wiki
test to see if this is shorter for cargo tables wikitext string limit |
removed output bloat to deal with max character limit of wikitext string |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<onlyinclude><includeonly>{{#if:{{{1|}}}|<!-- | <onlyinclude><includeonly>{{#if:{{{1|}}}|<!-- | ||
-->{{#vardefine:filename|{{{image|{{#replace:{{#replace:{{#replace:{{{1}}}|:|_}}|+|-}}|/|_}}.png}}}}}<!-- | -->{{#vardefine:filename|{{{image|{{#replace:{{#replace:{{#replace:{{{1}}}|:|_}}|+|-}}|/|_}}.png}}}}}<!-- | ||
-->{{#if:{{{quantity|}}}| {{{quantity}}} × }}<!-- | -->{{#if:{{{quantity|}}}| {{{quantity}}} × }}<!-- | ||
-->[[File:{{#var:filename}}|{{{size| | -->[[File:{{#var:filename}}|{{{size|16px}}}]] {{#if:{{{2|}}}|[[{{{1}}}|{{{2|}}}]]|[[{{{1}}}]]}}}}<!-- | ||
--></includeonly></onlyinclude> | --></includeonly></onlyinclude> | ||
{{doc}} | {{doc}} | ||
[[Category:Formatting templates]] | [[Category:Formatting templates]] | ||
Latest revision as of 12:33, 27 June 2026
Link to an item page with an item image in front:
Stone
Also supports an optional quantity in front: 5 ×
Stone
Usage
{{ItemLink|Stone}}
- first position= name of link, text and image (image can be changed with the additional parameter)
- second position= the text shown (leaving empty makes it use the first position parameter)
| Name | Type | Required | Default |
|---|---|---|---|
image
|
string
|
false
|
The value of the first positional parameter suffixed with .png
|
size
|
string
|
false
|
16x16px |
quantity
|
string
|
false
|
Examples
Both lines produce the same output:
{{ItemLink|Stone}} =
Stone
{{ItemLink|Stone|Stone|image=Stone.png|size=20px|quantity=}} =
Stone
Lowercase link:
{{ItemLink|Stone|stone}} =
stone
Plural link:
{{ItemLink|Stone|Stones}} =
Stones
Alternative: {{ItemLink|Stone}}s =
Stones
Quantity:
{{ItemLink|Stone|quantity=5}} = 5 ×
Stone
{{ItemLink|Stone|quantity=5-10}} = 5-10 ×
Stone


