Template:Software/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Revert to proper documentation.)
Line 1: Line 1:
{{Doc/subpage}}
<noinclude>{{doc|0}}</noinclude>
<div style="display:flex;"><div style="flex:1;">
{{todo|See [[Template:Software/doc (draft)]]}}
{{ModernTodo|Replace the complicated {{code|{{=}}suf}} method translations with [[/strings]] and {{tl|autolang}} + {{tl|uselangflags}} one instead.}}


{{Todo}}
{{tl|Software}} is the template that underlies the icon templates. It has 8 main parameters:
*{{Param}} – the way the icon will be displayed.
** Do not enter this value if you need a regular icon.
** Enter 1 to get the name of the game with a link to an article about the game.
** Enter 2 to get the icon and the name of the game after it.
** Enter 3 to get the same as in the case of the number 1, but with an additional design with colored text.
** Enter 4 to get the same as in the case of the number 2, but with an additional design with colored text.
** Enter "col" (without quotes) to get the color of the game. This is mainly needed for other templates.
** Enter "in", "also", "only", "since", "removed" or "not" (without quotes) to get the icon displayed along with additional text, like "(also in <game icon>)".
{{Note|<nowiki>however, the {{{1}}} parameter cannot be touched, it should always be "{{{1}}}" in the icon templates!</nowiki>}}
*{{Param|ico}} – the name of the icon is written here, but only the name itself, without "File:" and square brackets.
* {{Param|ico size}} - width of the icon. Should be {{mono|16px}} for most icons, unless it's double, like {{hls}}, in which case it should be {{mono|32px}}. Experimentation may be necessary for non-square icons.
{{tip|The software icon should be scaled to be in-line with the text size (using {{mono|{{param|ico size}}}}). While this is nominally "16 pixels tall", high-DPI displays will benefit from the file being higher resolutions; 32 pixels tall is generally sufficient, although any resolution can be used (MediaWiki will downscale the image automatically and only deliver the necessary resolution).}}
*{{Param|link}} – link to the article, external links do not work. If not used, the link will use the {{Param|name}} parameter.<br>Write without the brackets. Underscores and spaces are interchangeable.
{{tip|For Wikipedia links, prepend "Wikipedia:" to the page name (ex: [[Wikipedia:Gabe Newell]])}}
*{{Param|name}} – display name. Write without the "_".
*{{Param|name|suf=<number>}} – this parameter displays an alternate name based on the {{Param|nt}} parameter.
{{Note|it is strongly recommended to write the abbreviation of the game in the parameter {{Param|name0}}}}
*{{Param|col}} – the color of the game. If it is not specified, just do not enter this parameter, the standard color will be used: <span style="color:#ADD8E6;font-weight:bold">#ADD8E6</span>.<br> It's highly recommended that you use brighter color for better readability with dark/black pages.
*{{Param|addtext}} – additional text that will be written immediately after the icon. It is mainly needed to add other icons.
{{Note|Make sure to include <nowiki>"addtext={{{addtext|}}}" in the icon templates!</nowiki>}}
*{{Param|nt}} – this parameter will be used in the {{Param|name<number>}} parameter.


== Future Desired Parameters ==
=== Result ===
==== Modes ====
In the end, you should get something like this:
{| class="standard-table" width="100%"
 
|- style="position:sticky; z-index:10; top:0"
{{CodeBlock|src=[[Template:Portal2]]|lines=12|<nowiki>{{doc|docpage=Template:Hl2/doc}}
! width="15%" | Parameter
&lt;includeonly>&lt;onlyinclude>{{Software
! width="40%" | Description
| {{{1}}}
! Example
| ico = Portal2-16px.png
! width="20%" | Preview
| ico size = 16px
|-
| link = Portal 2
| align="center" | '''No Parameters'''
| name = {{Autolang|Portal 2|ko=포탈 2|zh=传送门 2|zh-tw=傳送門 2}}
| Link with text.
| name0 = portal2
| {{CodeBlock|<nowiki>{{Source 2}}</nowiki>}}
| col = #23B1E5
| align="center" | [[Source 2]]
| addtext = {{{addtext|}}}
|-
| nt = {{{nt|}}}
| align="center" | {{Code|preset=1| {{Param|icon}} }}
}}&lt;/onlyinclude>&lt;/includeonly></nowiki>}}
| Icon with a link.
 
| {{CodeBlock|<nowiki>{{Source 2|icon}}</nowiki>}}
=== Translations ===
| align="center" | [[File:Source2-256px.png|16px|link=Source 2]]
Translations are handled by the {{tl|link=In text}} Template.
|-
 
| align="center" | {{Code|preset=1| {{Param|color}} }}
===How To Use===
| Places the link color as text.
This is how the use of the template in articles will look like:
| {{CodeBlock|<nowiki>{{Source 2|color}}</nowiki>}}
| align="center" | #F2A52B
|}


==== Styles ====
{| class=wikitable
Styles should be applied to any modes. Each mode can have its own unique styles, but the number of styles for these modes is common.
! Code
{| class="standard-table" width="100%"
! Result
|- style="position:sticky; z-index:10; top:0"
! width="15%" | Parameter
! width="40%" | Description
! Example
! width="20%" | Preview
|-
|-
| align="center" | {{Code|preset=1| {{Param|0}} }}
| {{tlc|{{lcfirst:portal2}}}}
| Style 0 (None)
| {{ portal2 }}
| {{CodeBlock|<nowiki>{{Source 2|0}}</nowiki>}}
| align="center" | Source 2
|-
|-
| align="center" | '''No Parameters'''
| {{tlc|{{lcfirst:portal2}}|1}}
| Style 1 (Default)
| {{portal2|1}}
| {{CodeBlock|<nowiki>{{Source 2}}</nowiki>}}
| align="center" | [[Source 2]]
|-
|-
| align="center" | From {{Code|preset=1|{{Param|2}}}} to infinity
| {{tlc|{{lcfirst:portal2}}|2}}
| Infinite number of various styles.
| {{portal2|2}}
| {{CodeBlock|<nowiki>{{Source 2|2}}</nowiki>}}
{{CodeBlock|<nowiki>{{Source 2|3}}</nowiki>}}
{{CodeBlock|<nowiki>{{Source 2|4}}</nowiki>}}
| align="center" | See [[User:THE OWL/Sandbox#New version of the Software template|THE OWL's Sandbox]]
|}
 
==== Other ====
Other parameters that should be used when creating a child template or when using a child template on a page.
{| class="standard-table" width="100%"
|- style="position:sticky; z-index:10; top:0"
! width="15%" | Parameter
! width="40%" | Description
! Example
! width="20%" | Preview
|-
|-
| align="center" | {{Code|preset=1| {{Param|name}} }}
| {{tlc|{{lcfirst:portal2}}|3}}
| Name of the software.
| {{portal2|3}}
| {{CodeBlock|<nowiki>{{Software|name = Source 2}}</nowiki>}}
|
|-
|-
| align="center" | {{Code|preset=1| {{Param|name:<lang code>}} }}
| {{tlc|{{lcfirst:portal2}}|4}}
| Translation of the name.
| {{portal2|4}}
| {{CodeBlock|<nowiki>{{Software|name:zh = 起源2引擎}}</nowiki>}}
| align="center" | [[Source 2|起源2引擎]]
|-
|-
| align="center" | {{Code|preset=1| {{Param|name <2-4>}} }}
| {{tlc|{{lcfirst:portal2}}|ico}}
| Other software names.
| {{portal2|ico}}
| {{CodeBlock|<nowiki>{{Software|name 4 = Source 2 Engine}}</nowiki>}}
|
|-
|-
| align="center" | {{Code|preset=1| {{Param|name type}} }}
| {{tlc|{{lcfirst:portal2}}|col}}
| Switches between available names. In the example, an abbreviation was used, which can be found in the section [[#An example of the future desired code of child templates]].
| {{portal2|col}}
| {{CodeBlock|<nowiki>{{Source 2|nt = 4}}</nowiki>}}
| align="center" | [[Source 2|Source 2 Engine]]
|-
|-
| align="center" | {{Code|preset=1| {{Param|icon}} }}
| {{tlc|{{lcfirst:portal2}}|name}}
| ''Not to be confused with {{Param|icon}} of [[#Modes]].''
| {{portal2|name}}
 
The link icon.
| {{CodeBlock|<nowiki>{{Software|icon = Source2-256px.png}}</nowiki>}}
| rowspan="2" align="center" | See [[User:THE OWL/Sandbox|THE OWL's Sandbox]]
|-
|-
| align="center" | {{Code|preset=1| {{Param|icon size}} }}
| {{tlc|{{lcfirst:portal2}}|in}}
| The size of the link icon.
| {{portal2|in}}
| {{CodeBlock|<nowiki>{{Software|icon size = 16px}}</nowiki>}}
|-
|-
| align="center" | {{Code|preset=1| {{Param|color}} }}
| {{tlc|{{lcfirst:portal2}}|only}}
| ''Not to be confused with {{Param|color}} of [[#Modes]].''
| {{portal2|only}}
 
The color of the link. Can be text.
| {{CodeBlock|<nowiki>{{Software|color = #F2A52B}}</nowiki>}}
| align="center" | [[Source 2|<span style="color:#F2A52B">Source 2</span>]]
|-
| align="center" | {{Code|preset=1| {{Param|link}} }}
| Internal or Interwiki link. Overwrites all other links.
| {{CodeBlock|<nowiki>{{Software|link = Valve}}</nowiki>}}
| align="center" | [[Valve|Source 2]]
|-
|-
| align="center" | {{Code|preset=1| {{Param|link:external}} }}
| {{tlc|{{lcfirst:portal2}}|since}}
| External link.
| {{portal2|since}}
| {{CodeBlock|<nowiki>{{Software|link:external = www.valvesoftware.com}}</nowiki>}}
| align="center" | [https://www.valvesoftware.com/en Source 2]
|-
|-
| align="center" | {{Code|preset=1| {{Param|addtext:before}} }}
| {{tlc|{{lcfirst:portal2}}|not}}
| Adding text before the link content.
| {{portal2|not}}
| {{CodeBlock|<nowiki>{{Source 2|addtext:before = Hello, World!}}</nowiki>}}
| rowspan="2" align="center" | See [[User:THE OWL/Sandbox|THE OWL's Sandbox]]
|-
|-
| align="center" | {{Code|preset=1| {{Param|addtext:after}} }}
| {{tlc|{{lcfirst:portal2}}|also|addtext{{=}}{{tlf|csgo}} {{tlf|l4d2}}}}
| Adding text after the link content.
| {{portal2|also|addtext={{csgo}} {{l4d2}}}}
| {{CodeBlock|<nowiki>{{Source 2|addtext:after = Goodbye, World!}}</nowiki>}}
|}</div>
|}
 
== An example of the future desired code of child templates ==
{{CodeBlock|<nowiki>{{Software
| {{{1|}}}
| {{{2|}}}
 
| name = Counter-Strike: Global Offensive
| name:ru = Симулятор ожидания новейшей версии Source 2
 
| name 2 = csgo
| name 3 = CS:GO
| name type = {{{nt|}}}
 
| icon = csgo.png
| icon size = 16px
| color = E9B963
 
| addtext:before = {{{addtext:before|}}}
| addtext:after = {{{addtext:after|}}}
| link = {{{link|}}}
}}</nowiki>}}


{{Doc/Sandbox other| [[Category:Templates]] }}
<div>{{infobox template
| summary      = Aids in the creation of icon templates
| type        = Metatemplate
| creationdate = 04/04/2022<br><small>(04 April 2022)</small>
| translation  = Yes
| parser      = Yes
| var          = Yes
}}</div></div>

Revision as of 12:18, 13 June 2023

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Edit-copy.png
This is a documentation subpage for Template:Software.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

Template:ModernTodo

{{Software}} is the template that underlies the icon templates. It has 8 main parameters:

  • {{{1}}} – the way the icon will be displayed.
    • Do not enter this value if you need a regular icon.
    • Enter 1 to get the name of the game with a link to an article about the game.
    • Enter 2 to get the icon and the name of the game after it.
    • Enter 3 to get the same as in the case of the number 1, but with an additional design with colored text.
    • Enter 4 to get the same as in the case of the number 2, but with an additional design with colored text.
    • Enter "col" (without quotes) to get the color of the game. This is mainly needed for other templates.
    • Enter "in", "also", "only", "since", "removed" or "not" (without quotes) to get the icon displayed along with additional text, like "(also in <game icon>)".
Note.pngNote:however, the {{{1}}} parameter cannot be touched, it should always be "{{{1}}}" in the icon templates!
  • {{{ico}}} – the name of the icon is written here, but only the name itself, without "File:" and square brackets.
  • {{{ico size}}} - width of the icon. Should be 16px for most icons, unless it's double, like Half-Life: Source, in which case it should be 32px. Experimentation may be necessary for non-square icons.
Tip.pngTip:The software icon should be scaled to be in-line with the text size (using {{{ico size}}}). While this is nominally "16 pixels tall", high-DPI displays will benefit from the file being higher resolutions; 32 pixels tall is generally sufficient, although any resolution can be used (MediaWiki will downscale the image automatically and only deliver the necessary resolution).
  • {{{link}}} – link to the article, external links do not work. If not used, the link will use the {{{name}}} parameter.
    Write without the brackets. Underscores and spaces are interchangeable.
Tip.pngTip:For Wikipedia links, prepend "Wikipedia:" to the page name (ex: Wikipedia:Gabe Newell)
  • {{{name}}} – display name. Write without the "_".
  • {{{name}}} – this parameter displays an alternate name based on the {{{nt}}} parameter.
Note.pngNote:it is strongly recommended to write the abbreviation of the game in the parameter {{{name0}}}
  • {{{col}}} – the color of the game. If it is not specified, just do not enter this parameter, the standard color will be used: #ADD8E6.
    It's highly recommended that you use brighter color for better readability with dark/black pages.
  • {{{addtext}}} – additional text that will be written immediately after the icon. It is mainly needed to add other icons.
Note.pngNote:Make sure to include "addtext={{{addtext|}}}" in the icon templates!
  • {{{nt}}} – this parameter will be used in the {{{name<number>}}} parameter.

Result

In the end, you should get something like this:

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
{{doc|docpage=Template:Hl2/doc}} <includeonly><onlyinclude>{{Software | {{{1}}} | ico = Portal2-16px.png | ico size = 16px | link = Portal 2 | name = {{Autolang|Portal 2|ko=포탈 2|zh=传送门 2|zh-tw=傳送門 2}} | name0 = portal2 | col = #23B1E5 | addtext = {{{addtext|}}} | nt = {{{nt|}}} }}</onlyinclude></includeonly>

Translations

Translations are handled by the {{In text}} Template.

How To Use

This is how the use of the template in articles will look like:

Code Result
{{portal2}} Portal 2
{{portal2|1}} Portal 2
{{portal2|2}} Portal 2 Portal 2
{{portal2|3}} Portal 2
{{portal2|4}} Portal 2 Portal 2
{{portal2|ico}} Icon-Portal2.png
{{portal2|col}} #23B1E5
{{portal2|name}} Portal 2
{{portal2|in}} (in Portal 2)
{{portal2|only}} (only in Portal 2)
{{portal2|since}} (in all games since Portal 2)
{{portal2|not}} (not in Portal 2)
{{portal2|also|addtext={{csgo}} {{l4d2}}}} (also in Portal 2Counter-Strike: Global Offensive Left 4 Dead 2)
Template:Software
Logo-template.png
Summary
Aids in the creation of icon templates
Type
Metatemplate
Contributors
N/A
Creation date
04/04/2022
(04 April 2022)
Notes
N/A
Subpages
Documentation
Preload
N/A
Sandbox
Strings
Testcases
N/A
Other
N/A
Revision information
Latest editor
SirYodaJedi
Last edited
13/06/2023
20230613121839
Revision size
4841 bytes
4.841 kilobytes
0.004841 megabytes
Technical information
Page identifier
46333
Contains translations
Yes
Uses parser functions?
Yes
Uses variables?
Yes