Voxel Tycoon Wiki
(Added missing image for icons that don')
m (Forgot "File:" part)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly><span style="white-space:nowrap;">[[{{#ifexist: File:{{{image|{{{1}}}.png}}} | File:{{{image|{{{1}}}.png}}} | File:Missing.png}}|{{{size|x40px}}}|link={{{link|{{{1}}}}}}|alt=]] [[{{{link|{{{1}}}}}}|{{{text|{{{1}}}}}}]]</span></includeonly><noinclude>{{doc}}[[Category:Formatting templates]]</noinclude>
+
<includeonly><span style="white-space:nowrap;">[[{{#if: {{{imageexists|}}} | File:{{{image|{{{1}}}}}}.png | {{#ifexist: File:{{{image|{{{1}}}.png}}} | File:{{{image|{{{1}}}.png}}} | File:Missing.png }} }}|{{{size|x40px}}}|link={{{link|{{{1}}}}}}|alt=]] [[{{{link|{{{1}}}}}}|{{{text|{{{1}}}}}}]]</span></includeonly><noinclude>{{doc}}[[Category:Formatting templates]]</noinclude>

Latest revision as of 07:49, 6 May 2021

Template-info.png Documentation

This template takes a single parameter and provides a link to something accompanied by a 40px image of it. For this template to work, there must be a png image with the same name of the page you are trying to link to.

Optional parameters can change this behavior but are for most use cases unneeded.

Usage

{{ItemLink|1}}

Parameters

  • 1 is the main and only mandatory parameter. The template will add content equivalent to <span style="white-space:nowrap;">[[File:1.png|x40px|link=1|alt=]] [[1]]</span>.
  • image if specified will change the image used. Note that file extension must be specified if using this parameter.
  • link if specified will change the link target on the image and link.
  • size if specified will change the size of the associated image.
  • text if specified will change the display text of the link, but not the link target
  • imageexists see Pages with many links

Examples

{{ItemLink|Copper ore}} Copper ore

{{ItemLink|Alloy smelter}} Alloy smelter

{{ItemLink|Unknown item}} Unknown item

Pages with many links

For pages with too many links, the wiki will not compute all the #ifexist checks and the placeholder image will be used for all elements after the limit of 100 is reached. You can bypass this for items which you know have images by including the imageexists parameter and setting it to any value (true is recommended).

{{ItemLink|Copper ore|imageexists=true}} Copper ore

If you try this with an item that doesn't exist, it will show x40px.

{{ItemLink|Copper oreos|imageexists=true}} x40px Copper oreos