Difference between revisions of "User:Yrael Oramara/Sandbox/Template:GetSkillLink"
Line 1: | Line 1: | ||
− | [[Skills:{{#switch: {{{1|}}} | + | <onlyinclude>[[Skills:{{#switch: {{{1|}}} |
<!--------- SKILL GROUP: Armor ------------> | <!--------- SKILL GROUP: Armor ------------> | ||
| Armor Layering = Armor#Armor Layering{{!}}Armor Layering | | Armor Layering = Armor#Armor Layering{{!}}Armor Layering | ||
Line 453: | Line 453: | ||
<!--------- SKILL GROUP: Default ------------> | <!--------- SKILL GROUP: Default ------------> | ||
| #default = <span style="color:red" title="This is an obsolete skill, please correct the link.">{{{1|Unknown}}}</span>[[Category:Obsolete Skills]] | | #default = <span style="color:red" title="This is an obsolete skill, please correct the link.">{{{1|Unknown}}}</span>[[Category:Obsolete Skills]] | ||
− | }}{{#if:{{{2|}}}| {{{2}}}|}}]]<noinclude> | + | }}{{#if:{{{2|}}}| {{{2}}}|}}]]<onlyinclude> |
+ | |||
+ | <noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Revision as of 18:07, 15 March 2017
[[Skills:Unknown]]
This template produces a link to the appropriate skill page. It was created to streamline page writing (you no longer need to look up a skill's group in order to link to it, as this template will do it for you) and to flag any pages which need updating when CCP decides to rename or move skills in a future game expansion. Any pages with outdated skill links will be added to the category Obsolete Skills and will be shown in red on the page itself.
This template feeds the more general {{Sk}}
template; in most cases, it's recommended that you use {{Sk}}
to link to skills, as it has more options and is easier to use.
Syntax
{{User:Yrael oramara/Sandbox/Template:GetSkillLink | skill | level }} |
- skill
- The name of the skill you would like to link to. Please make sure it's capitalised properly (use title case spelling, i.e.
Gallente Strategic Cruiser
, notGallente strategic cruiser
).
- level
- The level of the skill (as per the usual Eve convention, use upper-case Roman numerals (like
I
,III
orV
)). This parameter is optional; you can omit it if you would only like to link to the skill without reference to a particular skill level.
Examples
{{User:Yrael Oramara/Sandbox/Template:GetSkillLink|Mechanics}}
gives <onlyinclude>Mechanics<onlyinclude>
Mechanics
{{User:Yrael Oramara/Sandbox/Template:GetSkillLink|Gallente Battleship}}
gives <onlyinclude>Gallente Battleship<onlyinclude>
{{User:Yrael Oramara/Sandbox/Template:GetSkillLink|Cloaking|IV}}
gives <onlyinclude>Cloaking IV<onlyinclude>
{{User:Yrael Oramara/Sandbox/Template:GetSkillLink|Wabbit-Hunting}}
gives <onlyinclude>[[Skills:Wabbit-Hunting]]<onlyinclude>
Dependencies
- The template uses
{{!}}
to generate the pipe character for the piped links.
See also
{{GetSkillPrice}}
and{{GetSkillMult}}
, very similar templates for the skillbook NPC-seeded price and the skill training time multiplier.{{Sk}}
and{{Skill}}
, the primary users of this template.
Development notes
- This template is, essentially, a lookup function for all the skills currently in the game. When CCP changes the skill names or groups, or adds/removes skills in a future expansion, update this template (as well as
{{GetSkillPrice}}
and{{GetSkillMult}}
). If skills are merely moved from one group to another, all the links (generated with, for instance,{{Sk}}
) on the wiki will be automatically updated. If skill names change, then any pages with obsolete skill names will be listed in Category:Obsolete Skills, so that you can easily find and correct them. - The skill information was last updated for: Rhea 1.0.
Instructions for updating the template
- The bulk of the template code is made up of a lookup table, implemented with the MediaWiki switch parser function. Each skill in the game is on a separate line, formatted like this:
| <skill name> = <skill group> # <skill name> {{!}} <skill name>
For example, the line for the Caldari Battleship skill looks like this:
| Caldari Battleship = Spaceship Command#Caldari Battleship{{!}}Caldari Battleship
What this line does is check if the first parameter passed to the template is equal to Caldari Battleship
. If it is, the template outputs
Spaceship Command#Caldari Battleship|Caldari Battleship
({{!}}
is equal to the pipe (|
) character). The template then adds square brackets, the Skills:
prefix, and a skill rank (if specified) to give a piped link to the skill entry for Caldari Battleship.
{{GetSkillPrice}}
and {{GetSkillMult}}
(which use a very similar coding for the skillbook price and training time multiplier).