Difference between revisions of "Template:Game name/doc"

From Valve Developer Community
Jump to: navigation, search
(Initial docs)
 
m (Changed examples table background to transparent.)
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
An inline template that displays a game's icon and name with colored text and the subtle background from the ''add'', ''only'', and ''also'' templates.
 
An inline template that displays a game's icon and name with colored text and the subtle background from the ''add'', ''only'', and ''also'' templates.
 
Intended for situations where the full game name is better than just its icon (such as in the middle of a sentence), and the reader's focus should be drawn to the presence of the game in whatever idea is being communicated.
 
Intended for situations where the full game name is better than just its icon (such as in the middle of a sentence), and the reader's focus should be drawn to the presence of the game in whatever idea is being communicated.
 +
 
==Usage==
 
==Usage==
This template has one unnamed parameter. The parameter should be the transclusion of exactly '''one''' template from [[:Category:Game icons]]. You can also specify the abbreviation of the game's name without the <nowiki>{{}}</nowiki> double braces.
+
This template has four parameters:
 +
*The first parameter has no name. The parameter should be the transclusion of exactly '''one''' template from [[:Category:Game icons]] without the <nowiki>{{}}</nowiki> double braces. If this parameter is omitted, then <code><nowiki>{{</nowiki>[[Template:game icon name|game icon name]]<nowiki>| {{{</nowiki><span style="color:white">'''name'''</span><nowiki>}}} }}</nowiki></code> will instead be used for it.
 +
*<span style="color:white">'''name'''</span> - this parameter is required for the name of the game. The name of the game must necessarily coincide with the title of the article of the game itself to which you are linking. Do not write the suffix there, for this there is a third parameter.
 +
:{{note|It is clear that it is inconvenient to constantly write down the name parameter with the full name of the game, but on the other hand, in this case "switch" is not used, which means that if a new game or mod appears, it will be enough just to add its icon as a template and then this game/mod will work fine with this template.}}
 +
*<span style="color:white">'''suf'''</span> - this parameter is needed so that the icon and the name of the game lead to the page of the language you need. Be sure to write "''':es'''" but not "'''es'''"
 +
*<span style="color:white">'''icon'''</span> - set this parameter to 0 to hide the game icon.
 +
*<span style="color:white">'''gl'''</span> - this parameter will make this template look like the "Game link" template.
  
 
==Examples==
 
==Examples==
 
+
{| style="background: none"
: <code><nowiki>{{GameName|{{hl2}}}}</nowiki></code> → {{GameName|{{hl2}}}}
+
| <code><nowiki>{{Game name|hl2|name=Half-Life 2}}</nowiki></code> || → {{Game name|hl2|name=Half-Life 2}}
: <code><nowiki>{{GameName|hl2}}</nowiki></code> → {{GameName|hl2}}
+
|-
 
+
| <code><nowiki>{{Game name|name=Half-Life 2}}</nowiki></code> || → {{Game name|name=Half-Life 2}}
: <code><nowiki>{{GameName|{{src07}}}}</nowiki></code> → {{GameName|{{src07}}}}
+
|-
: <code><nowiki>{{GameName|src07}}</nowiki></code> → {{GameName|src07}}
+
| <code><nowiki>{{Game name|src07|name=Source 2007}}</nowiki></code> || → {{Game name|src07|name=Source 2007}}
 
+
|-
: <code><nowiki>{{GameName|{{GMOD}}}}</nowiki></code> → {{GameName|{{GMOD}}}}
+
| <code><nowiki>{{Game name|GMOD|name=Garry's Mod}}</nowiki></code> || → {{Game name|GMOD|name=Garry's Mod}}
: <code><nowiki>{{GameName|GMOD}}</nowiki></code> → {{GameName|GMOD}}
+
|-
 +
| <code><nowiki>{{Game name|portal2|suf=:ru|name=Portal 2}}</nowiki></code> || → {{Game name|portal2|suf=:ru|name=Portal 2}}
 +
|-
 +
| <code><nowiki>{{Game name|l4d|icon=0|name=Left 4 Dead}}</nowiki></code> || → {{Game name|l4d|icon=0|name=Left 4 Dead}}
 +
|-
 +
| <code><nowiki>{{Game name|hl2|gl=1|name=Half-Life 2}}</nowiki></code> || → {{Game name|hl2|gl=1|name=Half-Life 2}}
 +
|}
  
 
==See Also==
 
==See Also==
 
* {{tl|Game color}}
 
* {{tl|Game color}}
 
+
* {{tl|Game icon name}}
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||

Latest revision as of 07:22, 2 October 2021

An inline template that displays a game's icon and name with colored text and the subtle background from the add, only, and also templates. Intended for situations where the full game name is better than just its icon (such as in the middle of a sentence), and the reader's focus should be drawn to the presence of the game in whatever idea is being communicated.

Usage

This template has four parameters:

  • The first parameter has no name. The parameter should be the transclusion of exactly one template from Category:Game icons without the {{}} double braces. If this parameter is omitted, then {{game icon name| {{{name}}} }} will instead be used for it.
  • name - this parameter is required for the name of the game. The name of the game must necessarily coincide with the title of the article of the game itself to which you are linking. Do not write the suffix there, for this there is a third parameter.
Note.png Note: It is clear that it is inconvenient to constantly write down the name parameter with the full name of the game, but on the other hand, in this case "switch" is not used, which means that if a new game or mod appears, it will be enough just to add its icon as a template and then this game/mod will work fine with this template.
  • suf - this parameter is needed so that the icon and the name of the game lead to the page of the language you need. Be sure to write ":es" but not "es"
  • icon - set this parameter to 0 to hide the game icon.
  • gl - this parameter will make this template look like the "Game link" template.

Examples

{{Game name|hl2|name=Half-Life 2}} Half-Life 2 Half-Life 2
{{Game name|name=Half-Life 2}} Half-Life 2 Half-Life 2
{{Game name|src07|name=Source 2007}} <Source><Source> Source 2007
{{Game name|GMOD|name=Garry's Mod}} Garry's Mod Garry's Mod
{{Game name|portal2|suf=:ru|name=Portal 2}} Portal 2 Portal 2
{{Game name|l4d|icon=0|name=Left 4 Dead}} Left 4 Dead
{{Game name|hl2|gl=1|name=Half-Life 2}} Half-Life 2 Half-Life 2

See Also