Difference between revisions of "Template:Game name"

From Valve Developer Community
Jump to: navigation, search
m (Added SFM and Dota 2)
(Added 'icon' parameter. Set to 0 to hide the game icon.)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span style="color:{{Game color|{{#switch: {{{1}}}
+
{{lang|Template:Game name}}
| {{src06}}
+
<onlyinclude><includeonly><!--
| src06 = {{src06}}
+
 
| {{src07}}
+
-->{{#if: {{{gl||}}}
| src07 = {{src07}}
+
| {{#ifeq: {{{icon|1}}} | 0
| {{src09}}
+
  |
| src09 = {{src09}}
+
  | {{#if: {{{1|}}}
| {{src13}}
+
    | {{ {{{1}}}|suf={{{suf|}}} }}
| src13 = {{src13}}
+
    | {{game icon| {{{name}}} | suf={{{suf|}}} }}
| {{src13mp}}
+
    }}
| src13mp = {{src13mp}}
+
  }}<!--
| {{hl1}}
+
  -->[[ {{{name|}}}{{{suf|}}} | {{{name|}}} ]]
| hl1 = {{hl1}}
+
| <span style="color:{{Game color| {{{1| {{{name}}} }}} }}; background-color:#202020; font-weight:bold; padding:2px; {{border-radius|4px}}"><!--
| {{HLS}}
+
  -->{{#ifeq: {{{icon|1}}} | 0
| HLS
+
    |
| hls = {{HLS}}
+
    | {{#if: {{{1|}}}
| {{hl2}}
+
      | {{ {{{1}}}|suf={{{suf|}}} }}
| hl2 = {{hl2}}
+
      | {{game icon| {{{name}}} | suf={{{suf|}}} }}
| {{ep1}}
+
      }}
| ep1 = {{ep1}}
+
    }}<!--
| {{ep2}}
+
  -->[[ {{{name|}}}{{{suf|}}} | <span style="color:{{Game color|{{{1| {{{name}}} }}}}};">{{{name|}}}</span> ]]<!--
| ep2 = {{ep2}}
+
  --></span>
| {{hl2episodes}}
+
}}<!--
| hl2episodes = {{hl2episodes}}
+
 
| {{tf2}}
+
--></includeonly></onlyinclude>
| tf2 = {{tf2}}
 
| {{l4d}}
 
| l4d = {{l4d}}
 
| {{l4d2}}
 
| l4d2 = {{l4d2}}
 
| {{as}}
 
| as = {{as}}
 
| {{asrd}}
 
| asrd = {{asrd}}
 
| {{portal}}
 
| portal = {{portal}}
 
| {{portal2}}
 
| portal2 = {{portal2}}
 
| {{P2CE}}
 
| P2CE = {{P2CE}}
 
| {{sin}}
 
| sin = {{sin}}
 
| {{bms}}
 
| bms
 
| Black Mesa (Source) = {{bms}}
 
| {{GMOD}}
 
| GMOD
 
| gmod = {{GMOD}}
 
| {{insurgency}}
 
| insurgency = {{insurgency}}
 
| {{con}}
 
| con = {{con}}
 
| {{csgo}}
 
| csgo = {{csgo}}
 
| {{mapbase}}
 
| mapbase = {{mapbase}}
 
| {{ez1}}
 
| ez1 = {{ez1}}
 
| {{ez2}}
 
| ez2 = {{ez2}}
 
| {{synergy}}
 
| synergy = {{synergy}}
 
| {{sfm}}
 
| sfm = {{sfm}}
 
| {{dota2}}
 
| dota2 = {{dota2}}
 
| #default = ?
 
}}}}; background-color: #202020; font-weight:bold; padding: 2px; {{border-radius|4px}}">{{#switch: {{{1}}}
 
| {{src06}}
 
| src06 = {{src06}}
 
| {{src07}}
 
| src07 = {{src07}}
 
| {{src09}}
 
| src09 = {{src09}}
 
| {{src13}}
 
| src13 = {{src13}}
 
| {{src13mp}}
 
| src13mp = {{src13mp}}
 
| {{hl1}}
 
| hl1 = {{hl1}}
 
| {{HLS}}
 
| HLS
 
| hls = {{HLS}}
 
| {{hl2}}
 
| hl2 = {{hl2}}
 
| {{ep1}}
 
| ep1 = {{ep1}}
 
| {{ep2}}
 
| ep2 = {{ep2}}
 
| {{hl2episodes}}
 
| hl2episodes = {{hl2episodes}}
 
| {{tf2}}
 
| tf2 = {{tf2}}
 
| {{l4d}}
 
| l4d = {{l4d}}
 
| {{l4d2}}
 
| l4d2 = {{l4d2}}
 
| {{as}}
 
| as = {{as}}
 
| {{asrd}}
 
| asrd = {{asrd}}
 
| {{portal}}
 
| portal = {{portal}}
 
| {{portal2}}
 
| portal2 = {{portal2}}
 
| {{P2CE}}
 
| P2CE = {{P2CE}}
 
| {{sin}}
 
| sin = {{sin}}
 
| {{bms}}
 
| bms
 
| Black Mesa (Source) = {{bms}}
 
| {{GMOD}}
 
| GMOD
 
| gmod = {{GMOD}}
 
| {{insurgency}}
 
| insurgency = {{insurgency}}
 
| {{con}}
 
| con = {{con}}
 
| {{csgo}}
 
| csgo = {{csgo}}
 
| {{mapbase}}
 
| mapbase = {{mapbase}}
 
| {{ez1}}
 
| ez1 = {{ez1}}
 
| {{ez2}}
 
| ez2 = {{ez2}}
 
| {{synergy}}
 
| synergy = {{synergy}}
 
| {{sfm}}
 
| sfm = {{sfm}}
 
| {{dota2}}
 
| dota2 = {{dota2}}
 
| #default = ?
 
}} [[{{#switch: {{{1}}}
 
| {{src06}}
 
| src06 = Source_2006
 
| {{src07}}
 
| src07 = Source_2007
 
| {{src09}}
 
| src09 = Source_2009
 
| {{src13}}
 
| src13 = Source_2013
 
| {{src13mp}}
 
| src13mp = Source_2013
 
| {{hl1}}
 
| hl1 = Half-Life
 
| {{HLS}}
 
| HLS
 
| hls = Half-Life:_Source
 
| {{hl2}}
 
| hl2 = Half-Life_2
 
| {{ep1}}
 
| ep1 = Half-Life_2:_Episode_One
 
| {{ep2}}
 
| ep2 = Half-Life_2:_Episode_Two
 
| {{tf2}}
 
| tf2 = Team_Fortress_2
 
| {{l4d}}
 
| l4d = Left_4_Dead
 
| {{l4d2}}
 
| l4d2 = Left_4_Dead_2
 
| {{as}}
 
| as = Alien_Swarm
 
| {{asrd}}
 
| asrd = Alien_Swarm:_Reactive_Drop
 
| {{portal}}
 
| portal = Portal
 
| {{portal2}}
 
| portal2 = Portal_2
 
| {{P2CE}}
 
| P2CE = Portal_2:_Community_Edition
 
| {{sin}}
 
| sin = SiN_Episodes
 
| {{bms}}
 
| bms
 
| Black Mesa (Source) = Black_Mesa_(Source)
 
| {{GMOD}}
 
| GMOD
 
| gmod = Garry's_Mod
 
| {{insurgency}}
 
| insurgency = Insurgency
 
| {{con}}
 
| con = Contagion
 
| {{csgo}}
 
| csgo = Counter-Strike:_Global_Offensive
 
| {{mapbase}}
 
| mapbase = Mapbase
 
| {{ez1}}
 
| ez1 = Entropy_:_Zero
 
| {{ez2}}
 
| ez2 = Entropy_:_Zero_2
 
| {{synergy}}
 
| synergy = Synergy
 
| {{sfm}}
 
| sfm = Source_Filmmaker
 
| {{dota2}}
 
| dota2 = Dota_2
 
| #default = ?
 
}}|<span style="color:{{Game color|{{#switch: {{{1}}}
 
| {{src06}}
 
| src06 = {{src06}}
 
| {{src07}}
 
| src07 = {{src07}}
 
| {{src09}}
 
| src09 = {{src09}}
 
| {{src13}}
 
| src13 = {{src13}}
 
| {{src13mp}}
 
| src13mp = {{src13mp}}
 
| {{hl1}}
 
| hl1 = {{hl1}}
 
| {{HLS}}
 
| HLS
 
| hls = {{HLS}}
 
| {{hl2}}
 
| hl2 = {{hl2}}
 
| {{ep1}}
 
| ep1 = {{ep1}}
 
| {{ep2}}
 
| ep2 = {{ep2}}
 
| {{hl2episodes}}
 
| hl2episodes = {{hl2episodes}}
 
| {{tf2}}
 
| tf2 = {{tf2}}
 
| {{l4d}}
 
| l4d = {{l4d}}
 
| {{l4d2}}
 
| l4d2 = {{l4d2}}
 
| {{as}}
 
| as = {{as}}
 
| {{asrd}}
 
| asrd = {{asrd}}
 
| {{portal}}
 
| portal = {{portal}}
 
| {{portal2}}
 
| portal2 = {{portal2}}
 
| {{P2CE}}
 
| P2CE = {{P2CE}}
 
| {{sin}}
 
| sin = {{sin}}
 
| {{bms}}
 
| bms
 
| Black Mesa (Source) = {{bms}}
 
| {{GMOD}}
 
| GMOD
 
| gmod = {{GMOD}}
 
| {{insurgency}}
 
| insurgency = {{insurgency}}
 
| {{con}}
 
| con = {{con}}
 
| {{csgo}}
 
| csgo = {{csgo}}
 
| {{mapbase}}
 
| mapbase = {{mapbase}}
 
| {{ez1}}
 
| ez1 = {{ez1}}
 
| {{ez2}}
 
| ez2 = {{ez2}}
 
| {{synergy}}
 
| synergy = {{synergy}}
 
| {{sfm}}
 
| sfm = {{sfm}}
 
| {{dota2}}
 
| dota2 = {{dota2}}
 
| #default = ?
 
}}}};font-weight:bold;">{{#switch: {{{1}}}
 
| {{src06}}
 
| src06 = Source 2006
 
| {{src07}}
 
| src07 = Source 2007
 
| {{src09}}
 
| src09 = Source 2009
 
| {{src13}}
 
| src13 = Source 2013
 
| {{src13mp}}
 
| src13mp = Source 2013 MP
 
| {{hl1}}
 
| hl1 = Half-Life
 
| {{HLS}}
 
| HLS
 
| hls = Half-Life: Source
 
| {{hl2}}
 
| hl2 = Half-Life 2
 
| {{ep1}}
 
| ep1 = Half-Life 2: Episode One
 
| {{ep2}}
 
| ep2 = Half-Life 2: Episode Two
 
| {{hl2episodes}}
 
| hl2episodes = Half-Life 2 episodes
 
| {{tf2}}
 
| tf2 = Team Fortress 2
 
| {{l4d}}
 
| l4d = Left 4 Dead
 
| {{l4d2}}
 
| l4d2 = Left 4 Dead 2
 
| {{as}}
 
| as = Alien Swarm
 
| {{asrd}}
 
| asrd = Alien Swarm: Reactive Drop
 
| {{portal}}
 
| portal = Portal
 
| {{portal2}}
 
| portal2 = Portal 2
 
| {{P2CE}}
 
| P2CE = Portal 2: Community Edition
 
| {{sin}}
 
| sin = Sin Episodes
 
| {{bms}}
 
| bms
 
| Black Mesa (Source) = Black Mesa
 
| {{GMOD}}
 
| GMOD
 
| gmod = Garry's Mod
 
| {{insurgency}}
 
| insurgency = Insurgency
 
| {{con}}
 
| con = Contagion
 
| {{csgo}}
 
| csgo = Counter-Strike: Global Offensive
 
| {{mapbase}}
 
| mapbase = Mapbase
 
| {{ez1}}
 
| ez1 = Entropy : Zero
 
| {{ez2}}
 
| ez2 = Entropy : Zero 2
 
| {{synergy}}
 
| synergy = Synergy
 
| {{sfm}}
 
| sfm = Source Filmmaker
 
| {{dota2}}
 
| dota2 = Dota 2
 
| #default = ???
 
}}</span>]]</span><noinclude>
 
 
{{documentation}}
 
{{documentation}}
 
<!-- Add categories to the /doc subpage, not here -->
 
<!-- Add categories to the /doc subpage, not here -->
 
<!-- Please excuse the ugliness of this template. -->
 
<!-- Unfortunately, this wiki does not have the mediawiki variables extension, so we have to copypasta the large switch blocks if they are needed more than once. >:( -->
 
 
<!-- I created this template with the name "GameName" but perhaps "Game name" would be more consistent with this Wiki's naming convention (considering the existence of "Game color"). Unfortunately, I do not have permission to rename this template... perhaps someone else can do this for me. -->
 
</noinclude>
 

Latest revision as of 18:29, 30 September 2021

English
Template icon Template documentation[view] [edit] [history] [purge]

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