Template:Species link: Difference between revisions
(Moving all documentation to the doc subpage so this can be loaded more easily.) Tag: Replaced |
(adding display parameter) |
||
Line 2: | Line 2: | ||
|species={{{1|{{{species|}}} }}} | |species={{{1|{{{species|}}} }}} | ||
|iconsize={{{2|{{{iconsize|}}} }}} | |iconsize={{{2|{{{iconsize|}}} }}} | ||
|display={{{display|}}} | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
Revision as of 03:51, 10 October 2024
Overview
Creates a link to a species' page.
Parameters
Species
The name of the species is the only required parameter. Use the name of the species as it appears in game. A missing or misspelled species name will result in an error.
If you do not wish to write the code species=
, you may skip that, but you must specify the name of the species before any other parameters.
Parameter | Type | Description |
---|---|---|
species | string | The name of the species, as it appears in the game, either singular or plural. |
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. There are currently no other options for this parameter.
|
Examples
Basic usage
{{Species link|species=Humans}}
Yields Humans, a text-height icon that flows well in paragraphs without impacting line height.
{{Species link|human|size=medium}}
Yields a slightly larger icon, suitable for easy recognition in tables:
{{Species link|human|large}}
Yields a larger icon, suitable for tables featuring the species as an important factor:
Other examples
{{Species link|species=Harpy|size=small|display=notext}}
Yields just a linked icon for the Harpies. Use this sparingly, because it is not as accessible, and in paragraphs the icons can be hard to distinguish. This is good in tables where the icon functions as a reminder than an important factor. An example where this is useful is in the infoboxes of buildings which feature specialization as an important factor, and the species icon is shown next to the specialization as just a quick reminder.
{{Species link|human|none}}
Yields just the text link, Humans, suitable for when mentioning more than one time in the same paragraph to avoid cluttering the paragraph with icons. (This is preferable to using a regular wiki link, so the styling matches, even if it appears to have the same styling right now.)
{{Species link|Foxes|size=gigantic}}
Providing an icon size that is not recognized does not return an error. Instead, the template shows the default, small icon size: Foxes
Errors
The following are error messages generated by calling the template incorrectly.
{{Species link}}
With no arguments: Lua error in Module:SpeciesLink at line 58: You must specify the name of the species. Please see the template documentation for how to use the parameters.
{{Species link|Centaurs}}
Naming a species that doesn't exist in the game: Lua error in Module:SpeciesLink at line 41: You specified an invalid species name. Please see the template documentation for how to use the parameters.