Template:IconLink: Difference between revisions
(ICONLINK HOW TO READ 13) |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 23: | Line 23: | ||
This template accepts up to 4 numbered parameters and an additional <code>nolink</code> parameter. | This template accepts up to 4 numbered parameters and an additional <code>nolink</code> parameter. | ||
The first parameter is the icon the link will be rendered with; for example, <code><nowiki>{{IconLink|sword}}</nowiki></code> will generate a link with a [[File:Sword icon.png]] icon in front of it. This parameter must match with an image name – for example, <code><nowiki>{{IconLink|booma}}</nowiki></code> matches <code><nowiki>Booma.png</nowiki></code> – or the link won't render properly. This template was made to be used with the specific icon images on this wiki – for example, <code><nowiki>{{IconLink|gun}}</nowiki></code> will automatically use <code><nowiki>Gun icon.png</nowiki></code> – however, any image is technically usable, and will be resized to a 16-pixel-wide image. | The first parameter is the icon the link will be rendered with; for example, <code><nowiki>{{IconLink|sword}}</nowiki></code> will generate a link with a [[File:Sword icon.png|16px]] icon in front of it. This parameter must match with an image name – for example, <code><nowiki>{{IconLink|booma}}</nowiki></code> matches <code><nowiki>Booma.png</nowiki></code> – or the link won't render properly. This template was made to be used with the specific icon images on this wiki – for example, <code><nowiki>{{IconLink|gun}}</nowiki></code> will automatically use <code><nowiki>Gun icon.png</nowiki></code> – however, any image is technically usable, and will be resized to a 16-pixel-wide image. | ||
The second parameter ''may'' be a color, but this is optional. Supported colors are <span class="link">link</span>, <span class="normal">normal</span>, <span class="white">white</span>, <span class="attributes">attributes</span>, <span class="green">green</span>, <span class="untekked">untekked</span>, <span class="cyan">cyan</span>, <span class="blue">blue</span>, <span class="rare">rare</span>, <span class="yellow">yellow</span>, <span class="es">es</span>, <span class="red">red</span>, <span class="native">native</span>, <span class="abeast">abeast</span>, <span class="ab">ab</span>, <span class="machine">machine</span>, <span class="dark">dark</span>, <span class="olga2">olga2</span>, and <span class="glow">glow</span>. | The second parameter ''may'' be a color, but this is optional. Supported colors are <span class="link">link</span>, <span class="normal">normal</span>, <span class="white">white</span>, <span class="attributes">attributes</span>, <span class="green">green</span>, <span class="untekked">untekked</span>, <span class="cyan">cyan</span>, <span class="blue">blue</span>, <span class="rare">rare</span>, <span class="yellow">yellow</span>, <span class="es">es</span>, <span class="red">red</span>, <span class="native">native</span>, <span class="abeast">abeast</span>, <span class="ab">ab</span>, <span class="machine">machine</span>, <span class="dark">dark</span>, <span class="olga2">olga2</span>, and <span class="glow">glow</span>. | ||
Line 29: | Line 29: | ||
:If a different value or no value is specified, it will automatically use the <span class="link">link</span> color, and the second parameter will instead become the page that the link points to. This is useful for quickly rendering a link that doesn't need a particular text color, like for a technique; for example, a [[Handgun]] has an icon but no specific in-game text color, so using <code><nowiki>{{IconLink|gun|Handgun}}</nowiki></code> will quickly render a {{IconLink|gun|Handgun}} link. However, all items already have easier-to-use templates; see [[:Category:Link templates]] for more information. | :If a different value or no value is specified, it will automatically use the <span class="link">link</span> color, and the second parameter will instead become the page that the link points to. This is useful for quickly rendering a link that doesn't need a particular text color, like for a technique; for example, a [[Handgun]] has an icon but no specific in-game text color, so using <code><nowiki>{{IconLink|gun|Handgun}}</nowiki></code> will quickly render a {{IconLink|gun|Handgun}} link. However, all items already have easier-to-use templates; see [[:Category:Link templates]] for more information. | ||
If a color was specified, the third parameter is the page that the link points to; for example, <code><nowiki>{{IconLink|cane|attributes|Baton}}</nowiki></code> becomes {{IconLink|cane|attributes|Baton}}. If a color was ''not'' specified, the third parameter is the ''text of the link'' | If a color was specified, the third parameter is the page that the link points to; for example, <code><nowiki>{{IconLink|cane|attributes|Baton}}</nowiki></code> becomes {{IconLink|cane|attributes|Baton}}. If a color was ''not'' specified, the third parameter is the ''text of the link''; <code><nowiki>{{IconLink|gun|Handgun|Bind Handgun}}</nowiki></code> renders as {{IconLink|gun|Handgun|Bind Handgun}}. | ||
The fourth parameter is optional, and only necessary if a color was specified. If this is the case, then the fourth parameter is the text of the link; <code><nowiki>{{IconLink|sword|untekked|Gladius|Demon's Gladius}}</nowiki></code> will render as {{IconLink|sword|untekked|Gladius|Demon's Gladius}}. | The fourth parameter is optional, and only necessary if a color was specified. If this is the case, then the fourth parameter is the text of the link; <code><nowiki>{{IconLink|sword|untekked|Gladius|Demon's Gladius}}</nowiki></code> will render as {{IconLink|sword|untekked|Gladius|Demon's Gladius}}. | ||
This template automatically changes itself from a link to simple bold text if the link points to the page the link is on; MediaWiki does this automatically with standalone links, but not image links, such as the icons that precede the text in this template. | |||
==Examples== | ==Examples== |
Latest revision as of 23:43, 13 August 2023
[[File:{{{1}}}.png|16px|middle|link=]][[|]]
Usage[edit source]
This template accepts up to 4 numbered parameters and an additional nolink
parameter.
The first parameter is the icon the link will be rendered with; for example, {{IconLink|sword}}
will generate a link with a icon in front of it. This parameter must match with an image name – for example, {{IconLink|booma}}
matches Booma.png
– or the link won't render properly. This template was made to be used with the specific icon images on this wiki – for example, {{IconLink|gun}}
will automatically use Gun icon.png
– however, any image is technically usable, and will be resized to a 16-pixel-wide image.
The second parameter may be a color, but this is optional. Supported colors are link, normal, white, attributes, green, untekked, cyan, blue, rare, yellow, es, red, native, abeast, ab, machine, dark, olga2, and glow.
- If a different value or no value is specified, it will automatically use the link color, and the second parameter will instead become the page that the link points to. This is useful for quickly rendering a link that doesn't need a particular text color, like for a technique; for example, a Handgun has an icon but no specific in-game text color, so using
{{IconLink|gun|Handgun}}
will quickly render a Handgun link. However, all items already have easier-to-use templates; see Category:Link templates for more information.
If a color was specified, the third parameter is the page that the link points to; for example, {{IconLink|cane|attributes|Baton}}
becomes Baton. If a color was not specified, the third parameter is the text of the link; {{IconLink|gun|Handgun|Bind Handgun}}
renders as Bind Handgun.
The fourth parameter is optional, and only necessary if a color was specified. If this is the case, then the fourth parameter is the text of the link; {{IconLink|sword|untekked|Gladius|Demon's Gladius}}
will render as Demon's Gladius.
This template automatically changes itself from a link to simple bold text if the link points to the page the link is on; MediaWiki does this automatically with standalone links, but not image links, such as the icons that precede the text in this template.
Examples[edit source]
{{IconLink|sword|Saber}}
{{IconLink|gun|attributes|Launcher|Charge Launcher +15}}
{{IconLink|unit|rare|V101}}
{{IconLink|cane|es|ES Windmill}}