Template:Service link/doc: Difference between revisions
(Moved documentation to subpage) |
(Rewrote the documentation to follow the lead of other link templates.) |
||
Line 1: | Line 1: | ||
== Overview == | |||
Creates a link to a service's page. | |||
The template validates that you have correctly spelled the service's 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. | |||
== Parameters == | |||
== | === Service === | ||
The name of the service is the only required parameter. Use it as it appears in-game; a missing or misspelled name will result in an error. | |||
If you do not wish to write the code <code>name=</code>, you may skip that, but you must specify the service before any other parameters. | |||
{|class=wikitable | |||
! Parameter !! Type !! Description | |||
|- | |||
| name || string || '''Required.''' The name of the service, as it appears in the game. | |||
|} | |||
== | === Output overrides === | ||
All of these parameters are optional and change how the link is formatted. | |||
{|class= | {|class=wikitable | ||
! Parameter !! Type !! Description | ! Parameter !! Type !! Description | ||
|- | |- | ||
| | | size || string || The size of the icon to display. Choose one of the following: | ||
* none | |||
* small | |||
* medium | |||
* large | |||
* huge (same as large for this template) | |||
The default is <code>small</code>, suitable for paragraphs. | |||
|- | |- | ||
| | | display || string || If you include <code>display=notext</code> only the icon will be rendered. | ||
|} | |} | ||
Specialization links that are written into paragraphs should use the small icon, which is the default. | |||
== Examples == | |||
=== Basic usage === | |||
<pre>{{Service link|Education}}</pre> | |||
Makes a simple link to the {{Service link|Education}} article with a small icon for use in-paragraphs like this one. Please do not use icons larger than this in paragraphs or it will push the lines further apart, decreasing readability. | |||
<pre>{{Service link|Education|size=medium}}</pre> | |||
Yields a moderately sized icon, suitable for use in lists and tables: | |||
{{Service link|Education|size=medium}} | |||
<pre>{{Service link|Education|size=large}}</pre> | |||
Yields a larger icon for good recognition for use in tables with space that allows it: | |||
{{Service link|Education|size=large}} | |||
= | <pre>{{Service link|Education|size=huge}}</pre> | ||
Yields a very large icon, suitable for headlining tables and sections that feature this service: | |||
{{Service link|Education|size=huge}} | |||
=== Other examples === | |||
<pre>{{Service link|Religion|none}}</pre> | |||
Yields only the label {{Service link|Religion|none}}, without an icon. This is a great alternative after using the regular link with the small icon in a paragraph, to avoid overwhelming the reader with icons. | |||
<pre>{{Service link|Religion|large|display=notext}}</pre> | |||
Yields only the icon, for situations where the meanings are clear but space is limited: | |||
{{Service link| | {{Service link|Religion|large|display=notext}} | ||
{{Service link| | <pre>{{Service link|Religion|size=gigantic}}</pre> | ||
Specifying an icon size that is not recognized does not return an error. Instead, it defaults to the small icon like this: {{Service link|Religion|size=gigantic}} | |||
=== Errors === | |||
The following are | The following are error messages generated by calling the template incorrectly. | ||
<pre>{{Service link}}</pre> | |||
With no arguments: {{Service link}} | |||
<pre>{{Service link|name=Healthcare}}</pre> | |||
Naming a specialization that doesn't exist in the game: {{Service link|name=Healthcare}} | |||
{{Service link| | <pre>{{Service link|large|Religion}}</pre> | ||
Swapping the order of the parameters so that the service is not first: {{Service link|large|Religion}} |
Latest revision as of 20:44, 9 November 2024
Overview
Creates a link to a service's page.
The template validates that you have correctly spelled the service's 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.
Parameters
Service
The name of the service is the only required parameter. Use it as it appears in-game; a missing or misspelled 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 service before any other parameters.
Parameter | Type | Description |
---|---|---|
name | string | Required. The name of the service, 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.
|
Specialization links that are written into paragraphs should use the small icon, which is the default.
Examples
Basic usage
{{Service link|Education}}
Makes a simple link to the Education article with a small icon for use in-paragraphs like this one. Please do not use icons larger than this in paragraphs or it will push the lines further apart, decreasing readability.
{{Service link|Education|size=medium}}
Yields a moderately sized icon, suitable for use in lists and tables:
{{Service link|Education|size=large}}
Yields a larger icon for good recognition for use in tables with space that allows it:
{{Service link|Education|size=huge}}
Yields a very large icon, suitable for headlining tables and sections that feature this service:
Other examples
{{Service link|Religion|none}}
Yields only the label Religion, without an icon. This is a great alternative after using the regular link with the small icon in a paragraph, to avoid overwhelming the reader with icons.
{{Service link|Religion|large|display=notext}}
Yields only the icon, for situations where the meanings are clear but space is limited:
{{Service link|Religion|size=gigantic}}
Specifying an icon size that is not recognized does not return an error. Instead, it defaults to the small icon like this: Religion
Errors
The following are error messages generated by calling the template incorrectly.
{{Service link}}
With no arguments: Lua error in Module:ServiceLink at line 72: The service you specified was not found. Please see the template documentation for how to use the parameters.
{{Service link|name=Healthcare}}
Naming a specialization that doesn't exist in the game: Lua error in Module:ServiceLink at line 48: The service you specified was not found. Please see the template documentation for how to use the parameters.
{{Service link|large|Religion}}
Swapping the order of the parameters so that the service is not first: Lua error in Module:ServiceLink at line 48: The service you specified was not found. Please see the template documentation for how to use the parameters.