Template:Specialization link: Difference between revisions
(updating to new parameters and function call; sorry for the change) |
(Moving documentation to subpage; adding display override parameter to lua call) Tag: Replaced |
||
Line 2: | Line 2: | ||
|spec={{{spec|{{{1|}}}}}} | |spec={{{spec|{{{1|}}}}}} | ||
|size={{{size|{{{2|}}}}}} | |size={{{size|{{{2|}}}}}} | ||
|display={{{display|}}} | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
{{Documentation}} | |||
[[Category:Link templates]] | [[Category:Link templates]] | ||
[[Category:Lua-based modules]]</noinclude> | [[Category:Lua-based modules]]</noinclude> |
Revision as of 18:02, 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 Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization. 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.
Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization.
{{Specialization link|Masonry|large}}
Yields a large icon, suitable to headline tables focusing on specializations.
Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization.
Other examples
{{Specialization link|Meat production|none}}
Yields only the label Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization., 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.
Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization.
{{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.
Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization.
{{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: Lua error in Module:SpecializationLink at line 39: The Specialization link template requires the name of a specialization..
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 39: The Specialization link template requires the name of a specialization.
{{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 39: The Specialization link template requires the name of a specialization.