Template:Specialization link: Difference between revisions
(Moving documentation to subpage; adding display override parameter to lua call) Tag: Replaced |
m (renaming first parameter to name for consistency with other link templates) |
||
Line 1: | Line 1: | ||
<includeonly>{{#invoke:SpecializationLink|main | <includeonly>{{#invoke:SpecializationLink|main | ||
| | |name={{{name|{{{1|}}}}}} | ||
|size={{{size|{{{2|}}}}}} | |size={{{size|{{{2|}}}}}} | ||
|display={{{display|}}} | |display={{{display|}}} |
Latest revision as of 21:52, 8 November 2024
Overview
Creates a link to a specialization's page.
The template validates that you have correctly spelled the specialization name, and it automatically looks up and includes the icon for you. Any links returned by this template should have articles and not be redlinks.
A shortcut exists for this template, Template:sl. You can use {{sl}}
instead of {{Specialization link}}
with the same parameters.
Parameters
Specialization
The name of the specialization is the only required parameter. Use it as it appears in-game; a missing or mispelled name will result in an error.
If you do not wish to write the code name=
, you may skip that, but you must specify the specialization before any other parameters.
Parameter | Type | Description |
---|---|---|
name | string | Required. The name of the specialization, as it appears in the game. |
Output overrides
All of these parameters are optional and change how the link is formatted.
Parameter | Type | Description |
---|---|---|
size | string | The size of the icon to display. Choose one of the following:
The default is |
display | string | If you include display=notext only the icon will be rendered.
If you include |
Specialization links that are written into paragraphs should use the small icon, which is the default.
Examples
Basic usage
{{Specialization link|Masonry}}
Makes a simple link to the Masonry article with a small icon for use in-line in paragraphs like this. Please do not use larger icons than this in paragraphs or it will push the lines further apart, decreasing readability.
{{Specialization link|Masonry|size=medium}}
Yields a moderately sized icon, suitable for use in lists and tables.
{{Specialization link|Masonry|large}}
Yields a large icon, suitable to headline tables focusing on specializations.
Other examples
{{Specialization link|Meat production|none}}
Yields only the label Meat production, without an icon. As a great alternative to displaying the small icon after the first mention of the specialization in a paragraph, to avoid overwhelming the reader with icons.
{{Specialization link|Meat production|large|display=notext}}
Yields only the icon, and can be leverage the high recognizability of specialization graphics.
{{Specialization link|Meat production|medium|display=show_type}}
Yields a longer label that includes the type of the specialization. Not as useful in most cases, but especially when comparing or grouping types of specializations.
{{Specialization link|Meat production|size=gigantic}}
Specifying an icon size that is not recognized does not return an error. Instead, it defaults to the small icon like this: Meat production.
Errors
The following are error messages generated by calling the template incorrectly.
{{Specialization link}}
With no arguments: Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization.
{{Specialization link|name=Shipbuilding}}
Naming a specialization that doesn't exist in the game: Lua error in Module:SpecializationLink at line 56: No specialization found with that name: Shipbuilding.
{{Specialization link|large|Meat production}}
Swapping the order of the parameters so that the specialization is not first: Lua error in Module:SpecializationLink at line 56: No specialization found with that name: large.