Difference between revisions of "Template:ItemLink/doc"

From Voxel Tycoon Wiki
Jump to: navigation, search
(→‎Examples: for `imageexists` parameter)
(Add `imageexists` to parameters)
 
Line 13: Line 13:
 
* <code>size</code> if specified will change the size of the associated image.
 
* <code>size</code> if specified will change the size of the associated image.
 
* <code>text</code> if specified will change the display text of the link, but not the link target
 
* <code>text</code> if specified will change the display text of the link, but not the link target
  +
* <code>imageexists</code> see [[#Pages with many links|Pages with many links]]
   
 
==Examples==
 
==Examples==
Line 24: Line 25:
 
{{ItemLink|Unknown item}}
 
{{ItemLink|Unknown item}}
   
  +
===Pages with many links===
For pages with too many links, the wiki will not compute all the [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions##ifexist <code>#ifexist</code>] checks and the placeholder image will be used for all elements after the limit is reached. You can bypass this for items which you know have images by including the <code>imageexists</code> parameter and setting it to any value (<code>true</code> is recommended).
 
  +
 
For pages with too many links, the wiki will not compute all the [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions##ifexist <code>#ifexist</code>] 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 <code>imageexists</code> parameter and setting it to any value (<code>true</code> is recommended).
   
 
{{tlx|ItemLink|Copper ore|3=imageexists=true}}
 
{{tlx|ItemLink|Copper ore|3=imageexists=true}}

Latest revision as of 08:06, 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