Template:Half-Life 2/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Replaced "fullico" with new "link". (Confusingly, "fullico" has various equivalent keywords: "nolink", "nl", "ico.nolink". Are those useful?))
 
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<noinclude>{{Doc/subpage}}</noinclude>
<noinclude>{{Doc/multi-subpage}}</noinclude>
== Usage ==
== Usage ==
{{Toc-right}}
{{Toc-right}}
{{#if:{{{DocParam5|}}}
|{{Shortcut|{{{DocParam5}}}}}
}}
Delivers the icon and/or a link of the game that has this abbreviation. Can also obtain the game color.
Delivers the icon and/or a link of the game that has this abbreviation. Can also obtain the game color.


This template is based on {{T|Software}}. Document on how to create the icon templates can be found there.
This template is based on {{T|Software}}. Document on how to create the icon templates can be found there.
{{Important|This template should not be used just because it looks "pretty" compared to a regular link.
Here is a list of the most suitable places:
* The beginning of an article about the software linked to by this template (for example, [[PUNT]]);
* Tables with a list of software (such as the [[Source#Products using Source|list of games released on Source]] or the [[:Category:Level Design|Level Design category]]);
* Discussion page;
* User page.
* In icon-only mode in a in-line list of several games (ex: saying something is {{only|{{hl2}} {{portal}} {{portal2}} }})
Its use anywhere other than as mentioned above is strongly not recommended due to poor page readability (icons and colorful links draw too much attention where it is not needed). Use with extreme caution and ignore the suggested list only when absolutely necessary.
{{todo|Describe in more detail the reasons for such restrictions and also add to the list above, if necessary.}}
}}


=== Parameters ===
=== Parameters ===
Line 10: Line 25:
* {{Param|nt}} – Optional: This option allows you to select a custom game and software name if it is specified in the template. 0 is most often a game abbreviation. You can click on "Edit" to view the available game/software names. Support both text and numbers, aswell as spacing between text/numbers.
* {{Param|nt}} – Optional: This option allows you to select a custom game and software name if it is specified in the template. 0 is most often a game abbreviation. You can click on "Edit" to view the available game/software names. Support both text and numbers, aswell as spacing between text/numbers.
* {{Param|addtext}} – Optional: If {{Param}} is set to {{Code|in}}, {{Code|also}}, {{Code|only}}, {{Code|since}}, {{Code|removed}} or {{Code|not}}, then the value of this parameter is inserted right after the game icon. Useful for multiple game icons.
* {{Param|addtext}} – Optional: If {{Param}} is set to {{Code|in}}, {{Code|also}}, {{Code|only}}, {{Code|since}}, {{Code|removed}} or {{Code|not}}, then the value of this parameter is inserted right after the game icon. Useful for multiple game icons.
* {{Param|link}} – Optional: If overwritten, the link will lead to another page on this wiki.


=== Icons ===
=== Icons ===
Line 15: Line 31:


For uploading new icons, it is recommended (but not required) that the icon filename should be kept consistent with the template name, followed by the word "icon" (example: {{Code|[[:File:Hl2 icon.png]]}} for {{T|hl2}}).
For uploading new icons, it is recommended (but not required) that the icon filename should be kept consistent with the template name, followed by the word "icon" (example: {{Code|[[:File:Hl2 icon.png]]}} for {{T|hl2}}).
=== Shortcuts ===
For shortcut names, see the right side of the page, if you don't see a shortcut table, then see <span class="plainlinks">[https://{{SERVERNAME}}/wiki/Special:WhatLinksHere?target=Template%3A{{urlencode:{{ROOTPAGENAME}}}}&namespace=10&hidetrans=1&hidelinks=1 <span style="color: #648cc8;">this page</span>]</span>.


=== Translations ===
=== Translations ===
Some Translations are handled by the {{T|In text}} Template. Others (such as game title/software title, etc...) will use {{T|Autolang}}. {{Param|suf}} parameters used for translations have been deprecated, but are currently being used in some pages for many reasons.
Translations are handled on the [[Template:Software/strings|strings]] page. Others (such as game title/software title, etc...) use {{code|<nowiki>#switch</nowiki>}} parser.  
 
{{Param|suf}} parameters used for translations have been deprecated, it has been changed and moved to the strings page which are loaded by the {{T|Language}} Template, but are currently being used in some pages for many reasons.


=== Examples ===
=== Examples ===
Line 79: Line 100:
| {{T|{{ROOTPAGENAME}}|{{P|4}}{{P|nt|hl2}}}}<br><small>(Custom name using text instead of number, not all templates have this however. <br>This example will only work with {{hl2|4}}.)</small>
| {{T|{{ROOTPAGENAME}}|{{P|4}}{{P|nt|hl2}}}}<br><small>(Custom name using text instead of number, not all templates have this however. <br>This example will only work with {{hl2|4}}.)</small>
| → {{{{ROOTPAGENAME}}|4|nt=hl2}}
| → {{{{ROOTPAGENAME}}|4|nt=hl2}}
|-
{{#if:{{{DocParam1|}}}
|
{{!}} {{T|{{ROOTPAGENAME}}|{{P|4}}{{P|nt|{{{DocParam1|None}}}}}}}
{{!}}  → {{{{ROOTPAGENAME}}|4|nt={{{DocParam1}}}}}
}}
|-
{{#if:{{{DocParam2|}}}
|
{{!}} {{T|{{ROOTPAGENAME}}|{{P|4}}{{P|nt|{{{DocParam2|None}}}}}}}
{{!}}  → {{{{ROOTPAGENAME}}|4|nt={{{DocParam2}}}}}
}}
|-
{{#if:{{{DocParam3|}}}
|
{{!}} {{T|{{ROOTPAGENAME}}|{{P|4}}{{P|nt|{{{DocParam3|None}}}}}}}
{{!}}  → {{{{ROOTPAGENAME}}|4|nt={{{DocParam3}}}}}
}}
|-
{{#if:{{{DocParam4|}}}
|
{{!}} {{T|{{ROOTPAGENAME}}|{{P|4}}{{P|nt|{{{DocParam4|None}}}}}}}
{{!}}  → {{{{ROOTPAGENAME}}|4|nt={{{DocParam4}}}}}
}}
|-
|-
| {{T|{{ROOTPAGENAME}}|{{P|in}}}}
| {{T|{{ROOTPAGENAME}}|{{P|in}}}}
Line 96: Line 141:
|-
|-
| {{T|{{ROOTPAGENAME}}|{{P|also}}{{P|addtext|{{T|{{#ifeq:{{FULLPAGENAME}}|Template:Csgo|Portal2|Csgo}}}} {{T|{{#ifeq:{{FULLPAGENAME}}|Template:L4d2|Portal2|L4d2}}}}}}}}
| {{T|{{ROOTPAGENAME}}|{{P|also}}{{P|addtext|{{T|{{#ifeq:{{FULLPAGENAME}}|Template:Csgo|Portal2|Csgo}}}} {{T|{{#ifeq:{{FULLPAGENAME}}|Template:L4d2|Portal2|L4d2}}}}}}}}
| → {{{{ROOTPAGENAME}}|also|addtext={{#ifeq:{{FULLPAGENAME}}|Template:Csgo|{{Portal2}}|{{Csgo}}}} {{#ifeq:{{FULLPAGENAME}}|Template:L4d2|{{Portal2}}|{{L4d2}}}}}}
| → {{{{ROOTPAGENAME}}|also|addtext=&nbsp;{{#ifeq:{{FULLPAGENAME}}|Template:Csgo|{{Portal2}}|{{Csgo}}}} {{#ifeq:{{FULLPAGENAME}}|Template:L4d2|{{Portal2}}|{{L4d2}}}}}}
|-
|-
| {{T|{{ROOTPAGENAME}}|{{P|name}}}}
| {{T|{{ROOTPAGENAME}}|{{P|name}}}}
Line 106: Line 151:
| {{T|{{ROOTPAGENAME}}|{{P|link}}}}
| {{T|{{ROOTPAGENAME}}|{{P|link}}}}
| → {{{{ROOTPAGENAME}}|link}}
| → {{{{ROOTPAGENAME}}|link}}
|-
| {{T|{{ROOTPAGENAME}}|{{P|extlink}}}}<br><small>(This will show the external link, if there isn't one, then it says no external link)</small>
| → {{{{ROOTPAGENAME}}|extlink}}
|-
|-
| {{T|{{ROOTPAGENAME}}|{{P|col}}}}
| {{T|{{ROOTPAGENAME}}|{{P|col}}}}
| → {{{{ROOTPAGENAME}}|col}}
| → {{{{ROOTPAGENAME}}|col}}
|-
| colspan=2 | Additional parameters for template series:
|-
| {{T|{{ROOTPAGENAME}}|{{P|ico1}}}}<br><small>(This will show the ico1 file name, if there isn't one, then it says no icon 1, same as below)</small>
| → {{{{ROOTPAGENAME}}|ico1}}
|-
| {{T|{{ROOTPAGENAME}}|{{P|ico2}}}}
| → {{{{ROOTPAGENAME}}|ico2}}
|-
| {{T|{{ROOTPAGENAME}}|{{P|ico3}}}}
| → {{{{ROOTPAGENAME}}|ico3}}
|-
| {{T|{{ROOTPAGENAME}}|{{P|ico1 name}}}}<br><small>(Name for the ico1, if there isn't one, then it says no ico1 name, same as below)</small>
| → {{{{ROOTPAGENAME}}|ico1 name}}
|-
| {{T|{{ROOTPAGENAME}}|{{P|ico2 name}}}}
| → {{{{ROOTPAGENAME}}|ico2 name}}
|-
| {{T|{{ROOTPAGENAME}}|{{P|ico3 name}}}}
| → {{{{ROOTPAGENAME}}|ico3 name}}
|}
|}



Latest revision as of 07:05, 24 October 2025

Edit-copy.png
This documentation subpage is used on many pages and changes may be widely noticed.
Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage.
Consider discussing changes on the talk page before implementing them.

Usage

Delivers the icon and/or a link of the game that has this abbreviation. Can also obtain the game color.

This template is based on {{Software}}. Document on how to create the icon templates can be found there.

Icon-Important.pngImportant:This template should not be used just because it looks "pretty" compared to a regular link.

Here is a list of the most suitable places:

  • The beginning of an article about the software linked to by this template (for example, PUNT);
  • Tables with a list of software (such as the list of games released on Source or the Level Design category);
  • Discussion page;
  • User page.
  • In icon-only mode in a in-line list of several games (ex: saying something is (only in Half-Life 2 Portal Portal 2))

Its use anywhere other than as mentioned above is strongly not recommended due to poor page readability (icons and colorful links draw too much attention where it is not needed). Use with extreme caution and ignore the suggested list only when absolutely necessary.

Todo: Describe in more detail the reasons for such restrictions and also add to the list above, if necessary.

Parameters

  • {{{1}}} – Optional: The representation, see the examples below. Can be set to: bold, 1, 1.bold, 2, 2.bold, 3, 3.1, 4, 4.1, in, also, only, since, removed, not, name, ico, link, col;
  • {{{nt}}} – Optional: This option allows you to select a custom game and software name if it is specified in the template. 0 is most often a game abbreviation. You can click on "Edit" to view the available game/software names. Support both text and numbers, aswell as spacing between text/numbers.
  • {{{addtext}}} – Optional: If {{{1}}} is set to in, also, only, since, removed or not, then the value of this parameter is inserted right after the game icon. Useful for multiple game icons.
  • {{{link}}} – Optional: If overwritten, the link will lead to another page on this wiki.

Icons

This template now natively supports icons with larger than 16px. The full-res icon (or 32px and higher) will not be sent to client automatically unless the user had a 4K+ or Apple Retina displays, which benefits the most.

For uploading new icons, it is recommended (but not required) that the icon filename should be kept consistent with the template name, followed by the word "icon" (example: File:Hl2 icon.png for {{hl2}}).

Shortcuts

For shortcut names, see the right side of the page, if you don't see a shortcut table, then see this page.

Translations

Translations are handled on the strings page. Others (such as game title/software title, etc...) use #switch parser.

{{{suf}}} parameters used for translations have been deprecated, it has been changed and moved to the strings page which are loaded by the {{Language}} Template, but are currently being used in some pages for many reasons.

Examples

Note.pngNote:Some of the examples given may lead to non-existent pages.
{{Half-Life 2}} Half-Life 2
{{Half-Life 2|bold}} Half-Life 2
{{Half-Life 2|1}} Half-Life 2
{{Half-Life 2|1.bold}} Half-Life 2
{{Half-Life 2|2}} Half-Life 2 Half-Life 2
{{Half-Life 2|2.bold}} Half-Life 2 Half-Life 2
{{Half-Life 2|3}} Half-Life 2
{{Half-Life 2|3.1}} Half-Life 2
{{Half-Life 2|3.1.nolink}}
(Same as above, without links to the article.)
Half-Life 2
{{Half-Life 2|3.2}} Half-Life 2
{{Half-Life 2|4}} Half-Life 2 Half-Life 2
{{Half-Life 2|4.1}} Half-Life 2 Half-Life 2
{{Half-Life 2|4.2}} Half-Life 2 Half-Life 2
{{Half-Life 2|4|nt=0}} Half-Life 2 HL2
{{Half-Life 2|4|nt=1}} Half-Life 2 Half-Life 2
{{Half-Life 2|4|nt=2}} Half-Life 2 Half-Life 2
{{Half-Life 2|4|nt=3}} Half-Life 2 Half-Life 2
{{Half-Life 2|4|nt=4}} Half-Life 2 Half-Life 2
{{Half-Life 2|4|nt=hl2}}
(Custom name using text instead of number, not all templates have this however.
This example will only work with Half-Life 2 Half-Life 2.)
Half-Life 2 HL2
{{Half-Life 2|in}} (in Half-Life 2)
{{Half-Life 2|only}} (only in Half-Life 2)
{{Half-Life 2|since}} (in all games since Half-Life 2)
{{Half-Life 2|not}} (not in Half-Life 2)
{{Half-Life 2|removed}} (removed since Half-Life 2)
{{Half-Life 2|also|addtext={{Csgo}} {{L4d2}}}} (also in Half-Life 2 Counter-Strike: Global Offensive Left 4 Dead 2)
{{Half-Life 2|name}} → Half-Life 2
{{Half-Life 2|ico}} → Hl2 icon.png
{{Half-Life 2|link}} → Half-Life 2
{{Half-Life 2|extlink}}
(This will show the external link, if there isn't one, then it says no external link)
→ No external link
{{Half-Life 2|col}} → #E6AC39
Additional parameters for template series:
{{Half-Life 2|ico1}}
(This will show the ico1 file name, if there isn't one, then it says no icon 1, same as below)
→ No icon 1
{{Half-Life 2|ico2}} → No icon 2
{{Half-Life 2|ico3}} → No icon 3
{{Half-Life 2|ico1 name}}
(Name for the ico1, if there isn't one, then it says no ico1 name, same as below)
→ No ico1 name
{{Half-Life 2|ico2 name}} → No ico2 name
{{Half-Life 2|ico3 name}} → No ico3 name