Difference between revisions of "Template:Specs-Link/Documentation"

From War Thunder Wiki
Jump to: navigation, search
(Added description)
 
(Usage: Updated override example)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{docpage}}
 
{{docpage}}
 +
__NOTOC__
 +
== Description ==
 +
This template can be used to quickly insert a link to the corresponding article of a vehicle using their code. The displayed link uses a shortened name of the vehicle.
  
This template can be used to quickly insert a link to the corresponding article of a vehicle using their code. The displayed link uses a shortened name of the vehicle. Example: {{Specs-Link|f-86f-40_japan}}
+
== Usage ==
 +
The template is structured as <code><nowiki>{{Specs-Link| "arg1" | "arg2"}}</nowiki></code>
 +
 
 +
* '''"arg1"''' must be the vehicle's in-game code. This can be found at the top of the vehicle's wiki article while in the wikitext editor, after "code=". This code is case sensitive. E.g. {{Specs-Link|f-86f-40_japan|f-86f-40_japan}}
 +
 
 +
* '''"arg2"''' is optional. It allows the overriding of the text inserted by the template, while retaining the correct link to the vehicle's article. Overriding should only be used in cases where it explicitly disambiguates the link. Example:
 +
** <code><nowiki>fw-190a-5</nowiki></code> displays as {{Specs-Link|fw-190a-5}}, while <code><nowiki>fw-190a-5_cannons</nowiki></code> also displays as {{Specs-Link|fw-190a-5_cannons}}. This can be confusing, so it would be acceptable to override <code><nowiki>fw-190a-5</nowiki></code> to display as {{Specs-Link|fw-190a-5|Fw 190 A-5/U12}}.
 +
** "arg2" also accepts 2 predefined values that set the form of the automatically inserted name.
 +
*** "short" - Inserts the name provided by <code><nowiki>{{Specs|pseudonym}}</nowiki></code> of the given vehicle. This is the same as the default behaviour (i.e. omitting "arg2" altogether).
 +
**** <code><nowiki>{{Specs-Link|us_m1_abrams}}</nowiki></code> : {{Specs-Link|us_m1_abrams}}
 +
**** <code><nowiki>{{Specs-Link|us_m1_abrams|short}}</nowiki></code> : {{Specs-Link|us_m1_abrams|short}}
 +
*** "full" - Inserts the name provided by <code><nowiki>{{Specs|name}}</nowiki></code> of the given vehicle, which sometimes but doesn't necessarily differ from <code><nowiki>{{Specs|pseudonym}}</nowiki></code>.
 +
**** <code><nowiki>{{Specs-Link|us_m1_abrams|full}}</nowiki></code> : {{Specs-Link|us_m1_abrams|full}}
  
 
{{sp-begin|TemplateData}}
 
{{sp-begin|TemplateData}}
 +
<div style="text-align:left">
 
<templatedata>
 
<templatedata>
 
{
 
{
"params": {},
+
"params": {
 +
"1": {
 +
"label": "Vehicle code",
 +
"description": "The vehicle's in-game code. This can be found at the top of the vehicle's wiki page while in the wikitext editor, after \"code=\".",
 +
"example": "f-86f-40_japan",
 +
"type": "string",
 +
"required": true
 +
},
 +
"2": {
 +
"label": "Optional name override",
 +
"description": "Overrides the displayed text of the link. DO NOT USE unless it explicitly disambiguates the link (i.e. if two different vehicles display with the same name).",
 +
"example": "Fw 190 A-5/U12",
 +
"type": "string"
 +
}
 +
},
 
"description": "This template can be used to quickly insert a link to the corresponding article of a vehicle using their code. The displayed link uses a shortened name of the vehicle."
 
"description": "This template can be used to quickly insert a link to the corresponding article of a vehicle using their code. The displayed link uses a shortened name of the vehicle."
 
}
 
}
 
</templatedata>
 
</templatedata>
 +
</div>
 
{{sp-end}}
 
{{sp-end}}

Latest revision as of 14:59, 27 April 2022

Description

This template can be used to quickly insert a link to the corresponding article of a vehicle using their code. The displayed link uses a shortened name of the vehicle.

Usage

The template is structured as {{Specs-Link| "arg1" | "arg2"}}

  • "arg1" must be the vehicle's in-game code. This can be found at the top of the vehicle's wiki article while in the wikitext editor, after "code=". This code is case sensitive. E.g. f-86f-40_japan
  • "arg2" is optional. It allows the overriding of the text inserted by the template, while retaining the correct link to the vehicle's article. Overriding should only be used in cases where it explicitly disambiguates the link. Example:
    • fw-190a-5 displays as Fw 190 A-5, while fw-190a-5_cannons also displays as Fw 190 A-5. This can be confusing, so it would be acceptable to override fw-190a-5 to display as Fw 190 A-5/U12.
    • "arg2" also accepts 2 predefined values that set the form of the automatically inserted name.
      • "short" - Inserts the name provided by {{Specs|pseudonym}} of the given vehicle. This is the same as the default behaviour (i.e. omitting "arg2" altogether).
      • "full" - Inserts the name provided by {{Specs|name}} of the given vehicle, which sometimes but doesn't necessarily differ from {{Specs|pseudonym}}.