Template:Specialization link

From Against the Storm Official Wiki
Revision as of 16:44, 15 February 2023 by Aeredor (talk | contribs) (created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


{{#invoke:SpecializationLink|renderLink|spec={{{1|{{{spec|}}} }}}|iconsize={{{2|{{{iconsize|}}} }}} }}


This template is used like this: {{Specialization link|spec|iconsize}}


This template calls renderLink in Module:SpecializationLink to make icons and short wiki links to a specialization's page. The icon can be small, huge, or in between. The small icon is sized appropriately to fit well into in-line text.

This template standardizes the display of icons and specializations throughout the wiki and simplifies the amount of writing that is necessary when adding new content pages.


Usage

Use the name of the specialization as it appears in the game.

Giving the template a specialization name will result in a text-sized icon and a link to the wiki page for that specialization . This is useful in-line with text in paragraphs, where specialization icons can still be recognized.


Telling the template what size to make the icon allows the icon to be larger and more distinguishable. This is useful when creating tables where a larger icon increases recognition. If you request a link to a specialization that doesn't exist, an error will appear.

The default is a small icon, for use in-line with text. You can also use med, large, huge, or write small explicitly, to describe the desired size of the icon, as you can see below.


Here are ways to call the template and the expected result:

Argument Examples Expected outcome
None {{Specialization link}} An error.
Specialization name or
Specialization name and a "small" icon size
{{Specialization link|Farming}}
{{Specialization link|Alchemy|small}}
A small, text-sized icon and link to the wiki page for the specialization.
Specialization name and a "med" icon size {{Specialization link|Farming|med}}
{{Specialization link|Meat production|med}}
A fair-sized specialization icon and a link to its wiki page.
Specialization name and a "large" icon size {{Specialization link|Farming|large}}
{{Specialization link|Wood|large}}
A large specialization icon and a link to its wiki page.
Resource name and a "huge" icon size {{Specialization link|Farming|huge}}
{{Specialization link|Engineering|huge}}
A very large specialization icon and a link to its wiki page.


Examples

The following are generated by calling the template, as shown in the examples in the table above.


1. {{Specialization link|Farming}} yields:

Farming Specialization Farming


2. {{Specialization link|Farming|med}} yields:

Farming Specialization Farming


3. {{Specialization link|Farming|large}} yields:

Farming Specialization Farming


4. {{Specialization link|Farming|huge}} yields (currently the same as large, since the icons are not high enough resolution to render that big).

Farming Specialization Farming


The following are error messages generated by calling the template incorrectly.


5. With no arguments, {{Specialization link}} yields:

The Specialization link template requires the name of a specialization.


6. With the name of something that doesn't exist in the game, {{Specialization link|Meat}} yields:

No specialization found with that name: Meat.


7. With no specialization but an icon size, {{Specialization link||large}} yields:

The Specialization link template requires the name of a specialization.


Finally, providing an icon size that is not recognized does not break the template.


8. With a valid specialization but invalid icon size, {{Specialization link|Farming|gigantic}} yields:

Farming Specialization Farming