Template:Perk link: Difference between revisions
m (added includeonly to help readability on template page itself) |
(Updated doc and added name parameter to correspond with updated module.) |
||
Line 1: | Line 1: | ||
<includeonly>{{#invoke:PerkLink|renderLink| | <includeonly>{{#invoke:PerkLink| renderLink | ||
| id = {{{id| {{{1|}}} }}} | |||
| name= {{{name|}}} | |||
| iconsize={{{iconsize|}}} | |||
}}</includeonly><noinclude> | |||
'''Perk link''' is a template that creates links to perks on the wiki and includes an optional icon for improved recognition. Reuses standardized icon sizes for consistency. | |||
The [[Template:pl]] is a shortcut to this template. | |||
== Overview == | |||
This template should be used liberally across the wiki, wherever the names of perks are mentioned in paragraphs or tables. When the accompanying icon is included, this helps expert player skim the content and helps new players get oriented. | |||
For in-paragraph display, which is presumed to be the most common utilization, the icon is omitted. For use in tables, the size <code>med</code> is recommended, just like in [[Template:Resource_link]], which improves consistency across the wiki. | |||
{{ | Use your judgment when writing content. The first mention of a perk in a paragraph should probably be done using this template, so that the link is readily available. But you may find that paragraphs densely mentioning perks become harder instead of easier to read because of the link colors. You may decide that after the first mention of the perk, it's better for subsequent references to be in plain text. For additional guidance on style, consult the [[Against_the_Storm_Official_Wiki:Style]] article. | ||
== Usage == | |||
<pre>{{Perk link|Burnt to a Crisp}}</pre> | |||
=== Parameters === | |||
You may use either the unique identifier of the perk or its name. If both are provided, the id takes precedence. Identifiers may be significantly different from the name, so double-check or use the perk's name. If you are using the perk's id, you can omit the parameter name. | |||
'''Unlike goods and buildings, the names of perks are not unique.''' If you provide a name that matches more than one perk, a link will still be created. It's up to us authors to provide any necessary disambiguation pages. | |||
{|class="wikitable" | |||
! Parameter !! Type !! Description | |||
|- | |||
| id || string || The unique identifier of the perk, including spaces. | |||
|- | |||
| name || string || The name of the perk, which may not be unique. | |||
|- | |||
| iconsize || string || One of the following values to indicate the desired size of the icon:<br /> | |||
<table><tr><td> | |||
* <code>none</code> | |||
* <code>small</code> | |||
* <code>med</code> | |||
* <code>large</code> | |||
* <code>huge</code> | |||
</td><td> | |||
which will prevent an icon from displaying, '''default'''<br /> | |||
which sizes the icon to {{ImgS}} from [[Template:ImgS]], not recommended<br /> | |||
which sizes the icon to {{ImgM}} from [[Template:ImgM]]<br /> | |||
which sizes the icon to {{ImgL}} from [[Template:ImgL]]<br /> | |||
which sizes the icon to {{ImgH}} from [[Template:ImgH]] | |||
</td></tr></table> | |||
|} | |||
=== Examples === | |||
With an id, <code><nowiki>{{pl|Training Gear 5pm}}</nowiki></code> yields a link with no icon to the perk {{pl|Training Gear 5pm}}, which works nicely in paragraphs. With a name instead, <code><nowiki>{{pl|name=Training Gear Delivery Line}}</nowiki></code> yields the same link, {{pl|name=Training Gear Delivery Line}}. | |||
For tables, use the medium size icons, like this: <code><nowiki>{{pl|Fedora Hat|iconsize=med}}</nowiki></code>. These icons are more recognizable in tables, where spacing and alignment facilitates readability. | |||
{|class="wikitable" | |||
! Perk ID !! Link to perk | |||
|- | |||
| Fedora Hat || {{pl|Fedora Hat|iconsize=med}} | |||
|} | |||
=== Errors === | |||
1. When the template is called without a perk id or name, the template reminds you that one is required. | |||
'''Example:''' | |||
Incorrect: <code><nowiki>{{Perk link}}</nowiki></code> | |||
{{Perk link}} | |||
2. You must spell identifiers and names correctly, including any punctuation and spaces. | |||
'''Example:''' | |||
Misspelled: <code><nowiki>{{pl|id=Fredora Hat|iconsize=med}}</nowiki></code> | |||
{{pl|id=Fredora Hat|iconsize=med}} | |||
Fixed: <code><nowiki>{{pl|id=Fedora Hat|iconsize=med}}</nowiki></code> | |||
{{pl|id=Fedora Hat|iconsize=med}} | |||
'''Example:''' | |||
Misspelled: <code><nowiki>{{pl|name=Traning Geer Devilery Line|iconsize=med}}</nowiki></code> | |||
{{pl|name=Traning Geer Devilery Line|iconsize=med}} | |||
Fixed: <code><nowiki>{{pl|name=Training Gear Delivery Line|iconsize=med}}</nowiki></code> | |||
{{pl|name=Training Gear Delivery Line|iconsize=med}} | |||
== Additional examples and errors == | |||
Here are ways to call the template and the expected result. | |||
{|class="wikitable ats-table-nobands" | |||
! Parameters !! Example !! Expected outcome | |||
|- | |||
| id only || <code><nowiki>{{pl|Coal for Cysts}}</nowiki></code> || A plain link to {{pl|Coal for Cysts}}, best for within paragraphs. | |||
|- | |||
| name only || <code><nowiki>{{pl|name=Burnt to a Crisp}}</nowiki></code> || A plain link to the same article, {{pl|name=Burnt to a Crisp}}. | |||
|- | |||
| id and iconsize || <code><nowiki>{{pl|Coal for Cysts|iconsize=small}}</nowiki></code> || A small, text-sized icon and a link to {{pl|Coal for Cysts|iconsize=small}}. Using this size of icon is not recommended. | |||
|- | |||
|rowspan=2| name and iconsize || <code><nowiki>{{pl|name=Burnt to a Crisp|iconsize=med}}</nowiki></code> || {{pl|name=Burnt to a Crisp|iconsize=med}}<br />Suitable link for tables. | |||
|- | |||
| <code><nowiki>{{pl|name=Burnt to a Crisp|iconsize=large}}</nowiki></code> || {{pl|name=Burnt to a Crisp|iconsize=large}}<br />Larger icon, suitable link for tables featuring or centered on data about the perk for increased recognition. | |||
|} | |||
</noinclude> |
Revision as of 00:06, 29 March 2024
Perk link is a template that creates links to perks on the wiki and includes an optional icon for improved recognition. Reuses standardized icon sizes for consistency.
The Template:pl is a shortcut to this template.
Overview
This template should be used liberally across the wiki, wherever the names of perks are mentioned in paragraphs or tables. When the accompanying icon is included, this helps expert player skim the content and helps new players get oriented.
For in-paragraph display, which is presumed to be the most common utilization, the icon is omitted. For use in tables, the size med
is recommended, just like in Template:Resource_link, which improves consistency across the wiki.
Use your judgment when writing content. The first mention of a perk in a paragraph should probably be done using this template, so that the link is readily available. But you may find that paragraphs densely mentioning perks become harder instead of easier to read because of the link colors. You may decide that after the first mention of the perk, it's better for subsequent references to be in plain text. For additional guidance on style, consult the Against_the_Storm_Official_Wiki:Style article.
Usage
{{Perk link|Burnt to a Crisp}}
Parameters
You may use either the unique identifier of the perk or its name. If both are provided, the id takes precedence. Identifiers may be significantly different from the name, so double-check or use the perk's name. If you are using the perk's id, you can omit the parameter name.
Unlike goods and buildings, the names of perks are not unique. If you provide a name that matches more than one perk, a link will still be created. It's up to us authors to provide any necessary disambiguation pages.
Parameter | Type | Description | ||
---|---|---|---|---|
id | string | The unique identifier of the perk, including spaces. | ||
name | string | The name of the perk, which may not be unique. | ||
iconsize | string | One of the following values to indicate the desired size of the icon:
|
Examples
With an id, {{pl|Training Gear 5pm}}
yields a link with no icon to the perk Training Gear Delivery Line, which works nicely in paragraphs. With a name instead, {{pl|name=Training Gear Delivery Line}}
yields the same link, Training Gear Delivery Line.
For tables, use the medium size icons, like this: {{pl|Fedora Hat|iconsize=med}}
. These icons are more recognizable in tables, where spacing and alignment facilitates readability.
Perk ID | Link to perk |
---|---|
Fedora Hat | Old Fedora Hat |
Errors
1. When the template is called without a perk id or name, the template reminds you that one is required.
Example:
Incorrect: {{Perk link}}
The Perk_link template requires the ID or name of a perk.
2. You must spell identifiers and names correctly, including any punctuation and spaces.
Example:
Misspelled: {{pl|id=Fredora Hat|iconsize=med}}
No perk found with that id: Fredora Hat.
Fixed: {{pl|id=Fedora Hat|iconsize=med}}
Example:
Misspelled: {{pl|name=Traning Geer Devilery Line|iconsize=med}}
No perk found with that name: Traning Geer Devilery Line.
Fixed: {{pl|name=Training Gear Delivery Line|iconsize=med}}
Additional examples and errors
Here are ways to call the template and the expected result.
Parameters | Example | Expected outcome |
---|---|---|
id only | {{pl|Coal for Cysts}} |
A plain link to Burnt to a Crisp, best for within paragraphs. |
name only | {{pl|name=Burnt to a Crisp}} |
A plain link to the same article, Burnt to a Crisp. |
id and iconsize | {{pl|Coal for Cysts|iconsize=small}} |
A small, text-sized icon and a link to Burnt to a Crisp. Using this size of icon is not recommended. |
name and iconsize | {{pl|name=Burnt to a Crisp|iconsize=med}} |
Burnt to a Crisp Suitable link for tables. |
{{pl|name=Burnt to a Crisp|iconsize=large}} |
Burnt to a Crisp Larger icon, suitable link for tables featuring or centered on data about the perk for increased recognition. |