Template:Software

From Open Fortress Wiki
Revision as of 06:50, 4 January 2025 by Kate (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Tip:This template now supports icons with 32px or larger, this meant that users can upload a large icon (128px for example) directly, without having to downscale the icon to 16px, as the MediaWiki software will do this automatically.
With the higher resolution icon available, these will benefits most 4K and Apple Retina display, and won't look blurry. See File:Icon-HL2.png.
It has been suggested that this article or section be merged with {{software external}}. (Discuss)
Todo: Use backward compatibility in all child templates. The improvement work may not continue soon, but some progress has already been made.
Bug:{{{addtext}}} does not work with all {{{1}}} options. Same is probably the case for {{{addtext-front}}}.  [todo tested in?]

Template Documentation [edit]

Todo: Replace the =suf method translations with /strings and #switch: {{language}} instead.

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

Parameter Description Value & Previews
{{{1}}} The way the icon will be displayed. Displays the icon only when not specified.

{{{1}}}Open Fortress (without specifying numbers)
{{{1|1}}}Open Fortress
{{{1|1.bold}}}Open Fortress
{{{1|2}}}Open Fortress Open Fortress
{{{1|2.bold}}}Open Fortress Open Fortress
{{{1|3}}}Open Fortress
{{{1|4}}}Open Fortress Open Fortress

Click "Expand" to see more 

{{{1|3-darker}}}Open Fortress
{{{1|3.1}}}Open Fortress
{{{1|3.2}}}Open Fortress
{{{1|4-darker}}}Open Fortress Open Fortress
{{{1|4.1}}}Open Fortress Open Fortress
{{{1|4.2}}}Open Fortress Open Fortress

Enter "col" (without quotes) to get the text color of the game/software. Enter "in", "also", "only", "since", "removed" or "not" (without quotes) to get the icon displayed along with additional text, like "(also in Open Fortress)".

Note:However, the {{{1}}} parameter cannot be touched, it should always be "{{{1}}}" in the icon templates!
Note:Colored text should be used when appropriate, otherwise it would clutter the page.
{{{name}}} Simply display the name. However this param is also used to add the abbreviation of the game for example (when you create/edit this template).
Note:it is strongly recommended to write the abbreviation of the game in the parameter {{{name0}}}, {{{name1}}}, etc... or {{{nameiPadOS}}} (if supported, in templates such as {{iOS}}.
Open Fortress
{{{bold}}} Same as above, with bold text. Open Fortress
{{{ico}}} The name of the icon is written here, but only the name itself, without "File:" and square brackets.
This same param is also used to display the icon you have specified when you create a new {{Software}} template. If the icon doesn't exist, it simply shows red link.
Icon-OpenFortress.png
{{{ico size}}} Width of the icon. Should be 16px for most icons, unless it's double, like Template:Vcd:hls, in which case it should be 32px, or more. Experimentation may be necessary for non-square icons.
Tip: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 (particulary such as Apple Retina display, or 4K+ displays) will benefit from the file being higher resolutions; 32 or 64 pixels tall is generally sufficient, although any resolution can be used (MediaWiki will downscale the image automatically and only deliver the necessary resolution).
N/A
{{{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, but not too bright or over-saturated.
#574168
{{{link}}} Link to the article, if not specified, the link will use the {{{name}}} parameter.
Write without the brackets. Underscores and spaces are interchangeable.
Tip:For Wikipedia links, prepend "WP:" (short for Wikipedia) to the page name (ex: WP:Gabe Newell, or Wikipedia:Gabe Newell) For external links, use {{software external}} and add {{{is outlink}}}.
N/A
{{{addtext}}} Additional text that will be written immediately after the icon. It is mainly needed to add other icons.
Note:Make sure to include | addtext = {{{addtext|}}} in the icon templates!
{{hl2|4|addtext=®}}Open Fortress Open Fortress®
{{{nt}}} This parameter will be used in the {{{name<number>}}} parameter, some software templates may also have {{{name<text>}}}, such as {{iOS}} and {{Mac}}.
Note:Make sure that the | nt = {{{nt|}}} part must be included on the icon templates for it to work! This parameters requires text to be displayed using {{{1}}} to use.
Open Fortress OF

Result & Copy and Paste

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 = Icon-OpenFortress.png | ico size = 16px | link = Open Fortress | name = {{#switch:{{ROOTPAGENAME}} | #default = Open Fortress }} | name0 = OF | suf = {{{suf|}}} | col = #574168 | addtext-front ={{{addtext-front|}}} | addtext ={{{addtext|}}} | nt ={{{nt|}}} }}</onlyinclude> </includeonly>

You can also copy and paste the code above to create a new icon template, or to convert old template ({{New icon}}) to {{Software}} and update {{Software}} templates.

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
{{of}} Open Fortress
{{of|1}} Open Fortress
{{of|2}} Open Fortress Open Fortress
{{of|3}} Open Fortress
{{of|3-darker}} Open Fortress
{{of|3.1}} Open Fortress
{{of|3.2}} Open Fortress
{{of|4}} Open Fortress Open Fortress
{{of|4-darker}} Open Fortress Open Fortress
{{of|4.1}} Open Fortress Open Fortress
{{of|4.2}} Open Fortress Open Fortress
{{of|ico}} Icon-OpenFortress.png
{{of|col}} #574168
{{of|name}} Open Fortress
{{of|bold}} Open Fortress
{{of|in}} (in Open Fortress)
{{of|only}} (only in Open Fortress)
{{of|since}} (in all games since Open Fortress)
{{of|not}} (not in Open Fortress)
{{of|also|addtext=&nbsp;{{csgo}} {{l4d2}}}} (also in Open Fortress Counter-Strike: Global Offensive Left 4 Dead 2)
Template:Software
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
N/A
Preload
N/A
Sandbox
N/A
Strings
Testcases
N/A
Other
N/A
Revision information
Latest editor
Kate
Last edited
04/01/2025
20250104065010
Revision size
9939 bytes
9.939 kilobytes
0.009939 megabytes
Technical information
Page identifier
193
Contains translations
Yes
Uses parser functions?
Yes
Uses variables?
Yes