Template:Software/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(One Big Todo)
Line 1: Line 1:
<noinclude>{{doc|0}}</noinclude>
{{Doc/subpage}}
<div style="display:flex;"><div style="flex:1;">
{{ModernTodo|Replace the complicated {{code|{{=}}suf}} method translations with [[/strings]] and {{tl|autolang}} + {{tl|uselangflags}} one instead.}}


{{tl|Software}} is the template that underlies the icon templates. It has 8 main parameters:
{{Todo}}
*{{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 actual icon does not need to be this resolution; higher resolutions can be used to improve clarity on [[Wikipedia:Pixel density|high-PPI]] displays. MediaWiki will automatically send the resolution best suited for the given user-client's display.}}
*{{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.


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


{| class=wikitable
==== Styles ====
! Code
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.
! Result
{| class="standard-table" width="100%"
|- style="position:sticky; top:0"
! width="15%" | Parameter
! width="40%" | Description
! Example
! width="20%" | Preview
|-
|-
| {{tlc|{{lcfirst:portal2}}}}
| align="center" | {{Code|preset=1| {{Param|0}} }}
| {{ portal2 }}
| Style 0 (None)
| {{CodeBlock|<nowiki>{{Source 2|0}}</nowiki>}}
| align="center" | Source 2
|-
|-
| {{tlc|{{lcfirst:portal2}}|1}}
| align="center" | {{Code|preset=1| {{Param|1}} }}
| {{portal2|1}}
| Style 1 (Default)
| {{CodeBlock|<nowiki>{{Source 2}}</nowiki>}}
| align="center" | [[Source 2]]
|-
|-
| {{tlc|{{lcfirst:portal2}}|2}}
| align="center" | From {{Code|preset=1|{{Param|2}}}} to infinity
| {{portal2|2}}
| Infinite number of various styles.
| {{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; top:0"
! width="15%" | Parameter
! width="40%" | Description
! Example
! width="20%" | Preview
|-
|-
| {{tlc|{{lcfirst:portal2}}|3}}
| align="center" | {{Code|preset=1| {{Param|name}} }}
| {{portal2|3}}
| Name of the software.
| {{CodeBlock|<nowiki>{{Software|name = Source 2}}</nowiki>}}
|
|-
|-
| {{tlc|{{lcfirst:portal2}}|4}}
| align="center" | {{Code|preset=1| {{Param|name:<lang code>}} }}
| {{portal2|4}}
| Translation of the name.
| {{CodeBlock|<nowiki>{{Software|name:zh = 起源2引擎}}</nowiki>}}
| align="center" | [[Source 2|起源2引擎]]
|-
|-
| {{tlc|{{lcfirst:portal2}}|ico}}
| align="center" | {{Code|preset=1| {{Param|name <2-4>}} }}
| {{portal2|ico}}
| Other software names.
| {{CodeBlock|<nowiki>{{Software|name 4 = Source 2 Engine}}</nowiki>}}
|
|-
|-
| {{tlc|{{lcfirst:portal2}}|col}}
| align="center" | {{Code|preset=1| {{Param|name type}} }}
| {{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]].
| {{CodeBlock|<nowiki>{{Source 2|nt = 4}}</nowiki>}}
| align="center" | [[Source 2|Source 2 Engine]]
|-
|-
| {{tlc|{{lcfirst:portal2}}|name}}
| align="center" | {{Code|preset=1| {{Param|icon}} }}
| {{portal2|name}}
| ''Not to be confused with {{Param|icon}} of [[#Modes]].''
 
The link icon.
| {{CodeBlock|<nowiki>{{Software|icon = Source2-256px.png}}</nowiki>}}
| rowspan="2" align="center" | See [[User:THE OWL/Sandbox|THE OWL's Sandbox]]
|-
|-
| {{tlc|{{lcfirst:portal2}}|in}}
| align="center" | {{Code|preset=1| {{Param|icon size}} }}
| {{portal2|in}}
| The size of the link icon.
| {{CodeBlock|<nowiki>{{Software|icon size = 16px}}</nowiki>}}
|-
|-
| {{tlc|{{lcfirst:portal2}}|only}}
| align="center" | {{Code|preset=1| {{Param|color}} }}
| {{portal2|only}}
| ''Not to be confused with {{Param|color}} of [[#Modes]].''
 
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]]
|-
|-
| {{tlc|{{lcfirst:portal2}}|since}}
| align="center" | {{Code|preset=1| {{Param|link:external}} }}
| {{portal2|since}}
| External link.
| {{CodeBlock|<nowiki>{{Software|link = www.valvesoftware.com}}</nowiki>}}
| align="center" | [https://www.valvesoftware.com/en Source 2]
|-
|-
| {{tlc|{{lcfirst:portal2}}|not}}
| align="center" | {{Code|preset=1| {{Param|addtext:before}} }}
| {{portal2|not}}
| Addtext before link contents.
| {{CodeBlock|<nowiki>{{Source 2|addtext:before = Hello, World!}}</nowiki>}}
| rowspan="2" align="center" | See [[User:THE OWL/Sandbox|THE OWL's Sandbox]]
|-
|-
| {{tlc|{{lcfirst:portal2}}|also|addtext{{=}}{{tlf|csgo}} {{tlf|l4d2}}}}
| align="center" | {{Code|preset=1| {{Param|addtext:after}} }}
| {{portal2|also|addtext={{csgo}} {{l4d2}}}}
| Addtext after link contents.
|}</div>
| {{CodeBlock|<nowiki>{{Source 2|addtext:after = Goodbye, World!}}</nowiki>}}
|}
 
== An example of the future desired code ==
{{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>}}


<div>{{infobox template
{{Doc/Sandbox other| [[Category:Templates]] }}
| 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 11:59, 8 June 2023

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.

[Todo]

Future Desired Parameters

Modes

Parameter Description Example Preview
No Parameters Link with text.
{{Source 2}}
Source 2
{{{icon}}} Icon with a link.
{{Source 2|icon}}
Source2-256px.png
{{{color}}} Places the link color as text.
{{Source 2|color}}
#F2A52B

Styles

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.

Parameter Description Example Preview
{{{0}}} Style 0 (None)
{{Source 2|0}}
Source 2
{{{1}}} Style 1 (Default)
{{Source 2}}
Source 2
From {{{2}}} to infinity Infinite number of various styles.
{{Source 2|2}}
{{Source 2|3}}
{{Source 2|4}}
See 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.

Parameter Description Example Preview
{{{name}}} Name of the software.
{{Software|name = Source 2}}
{{{name:<lang code>}}} Translation of the name.
{{Software|name:zh = 起源2引擎}}
起源2引擎
{{{name <2-4>}}} Other software names.
{{Software|name 4 = Source 2 Engine}}
{{{name type}}} 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.
{{Source 2|nt = 4}}
Source 2 Engine
{{{icon}}} Not to be confused with {{{icon}}} of #Modes.

The link icon.

{{Software|icon = Source2-256px.png}}
See THE OWL's Sandbox
{{{icon size}}} The size of the link icon.
{{Software|icon size = 16px}}
{{{color}}} Not to be confused with {{{color}}} of #Modes.

The color of the link. Can be text.

{{Software|color = #F2A52B}}
Source 2
{{{link}}} Internal or Interwiki link. Overwrites all other links.
{{Software|link = Valve}}
Source 2
{{{link:external}}} External link.
{{Software|link = www.valvesoftware.com}}
Source 2
{{{addtext:before}}} Addtext before link contents.
{{Source 2|addtext:before = Hello, World!}}
See THE OWL's Sandbox
{{{addtext:after}}} Addtext after link contents.
{{Source 2|addtext:after = Goodbye, World!}}

An example of the future desired code

{{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|}}} }}