Template:Software inline: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly><onlyinclude><span {{#ifeq:{{padleft:|1|{{bidi:{{int:edit}}}}}}|&#x202B;|dir=rtl}} style="white-space:nowrap">{{#ifeq:{{{1}}}|name||<span style="user-select:none; position:relative; top:-1px">[[File:{{{icon}}}|16px|link={{{link|}}}]]{{#ifeq:{{{1}}}|icon||&#32;}}</span>}}{{#ifeq:{{{1}}}|icon||{{#if:{{{link|}}}|{{#if:{{{elink|}}}|[{{{link}}} <span {{#ifeq:{{{2}}}|colored|style="font-weight:bold; color:{{{color|#5081D1}}}"}}>{{{name|}}}</span>]|[[:{{{link}}}|<span {{#ifeq:{{{2}}}|colored|style="font-weight:bold; color:{{{color|#5081D1}}}"}}>{{{name|}}}</span>]]}}|{{{name}}}}}}}</span></onlyinclude></includeonly>
<includeonly><onlyinclude>{{#ifeq:{{{1|}}}|color|{{#tag:nowiki|{{{color|#5081D1}}}}}|<span style="{{#ifeq:{{{2|}}}|styled|{{#if:{{{link|}}}||color:{{{color|#5081D1}}};}} padding:2px 3px; border-radius:3px; background:#00000030; font-weight:bold;}} white-space:nowrap">{{#ifeq:{{{1|}}}|name||<span style="{{#ifeq:{{{1|}}}|icon||margin-inline-end:.2em;}} font-size:16px; user-select:none">[[File:{{{icon}}}|16px|link={{{link|}}}]]</span>}}{{#ifeq:{{{1|}}}|icon||{{#if:{{{link|}}}|{{#if:{{{external|}}}|[{{{link}}} {{#ifeq:{{{2|}}}|styled|<span style="color:{{{color|#5081D1}}}">{{{name|}}}</span>|{{{name|}}}}}]|[[:{{{link}}}|{{#ifeq:{{{2|}}}|styled|<span style="color:{{{color|#5081D1}}}">{{{name|}}}</span>|{{{name|}}}}}]]}}|{{{name|}}}}}}}</span>}}</onlyinclude></includeonly>
This template is an improved and simplified version of template [[Template:Software]].
This template is an improved and simplified version of template [[Template:Software]].


Line 6: Line 6:
* {{Param|color}} – The color that is used for colored style of this template. Supports hex, rgb, hsl, etc.
* {{Param|color}} – The color that is used for colored style of this template. Supports hex, rgb, hsl, etc.
* {{Param|icon}} – An icon that will be displayed next to the game name. You only need to enter the name and format of the image, for example, {{Code|SomeImage.png}}.
* {{Param|icon}} – An icon that will be displayed next to the game name. You only need to enter the name and format of the image, for example, {{Code|SomeImage.png}}.
* {{Param|external}} – Whether the link in the link parameter is external.
* {{Param|link}} – The link that will be used.
* {{Param|link}} – The link that will be used.
* {{Param|name}} – The name that will be displayed.
* {{Param|name}} – The name that will be displayed.
Line 15: Line 16:
| color = #23B1E5
| color = #23B1E5
| icon = Portal2-16px.png
| icon = Portal2-16px.png
| link = {{#if:{{{link|.}}}| {{Langprefix}}Portal 2 }}
| link = {{#if:{{{link}}}| {{Langprefix}}Portal 2 }}
| name = {{#switch:{{Language}}|#default=Portal 2|ru=Портал 2}}
| name = {{#switch:{{Language}}|#default=Portal 2|ru=Портал 2}}
}}</nowiki>}}
}}</nowiki>}}
Line 39: Line 40:
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Cs2d}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Cs2d}}</nowiki>}} }}
  {{td| This is {{Software inline|color=#FFD700|icon=CS2D icon.png|elink=1|link=https://store.steampowered.com/app/666220/CS2D|name=CS2D}}! }}
  {{td| This is {{Software inline|color=#FFD700|icon=CS2D icon.png|external=1|link=https://store.steampowered.com/app/666220/CS2D|name=CS2D}}! }}
  {{td| External link. }}
  {{td| External link. }}
}}
}}
Line 53: Line 54:
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|colored}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal2|styled}}</nowiki>}} }}
  {{td| This is {{Software inline|colored|colored|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|styled|styled|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| Link with colored text. }}
  {{td| Link with styling. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|name|colored}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal2|name|styled}}</nowiki>}} }}
  {{td| This is {{Software inline|name|colored|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|name|styled|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| Link without icon and with colored text. }}
  {{td| Link without icon and with styling. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Hammer|colored}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Hammer|styled}}</nowiki>}} }}
  {{td| This is {{Software inline|colored|colored|color=#6165AD|icon=Hammer-16px.png|link=Valve Hammer Editor|name=Hammer}}! }}
  {{td| This is {{Software inline|styled|styled|color=#6165AD|icon=Hammer-16px.png|link=Valve Hammer Editor|name=Hammer}}!}}
  {{td| Link with colored text. }}
  {{td| Link with styling. }}
}}
}}
{{tr|
{{tr|
Line 76: Line 77:
  {{td| This is {{Software inline|color=#23B1E5|icon=Portal2-16px.png|name|name|link=|name=Portal 2}}! }}
  {{td| This is {{Software inline|color=#23B1E5|icon=Portal2-16px.png|name|name|link=|name=Portal 2}}! }}
  {{td| No Link without icon. }}
  {{td| No Link without icon. }}
}}
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|color}}</nowiki>}} }}
  {{td| This is {{Software inline|color|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| Template color. }}
}}
}}
}}
}}

Latest revision as of 18:25, 12 May 2025

This template is an improved and simplified version of template Template:Software.

Parameters

  • {{{1}}}, {{{2}}} – Specially prepared code is written into these parameters for the convenient ability to select styles and display type in child templates (see example below).
  • {{{color}}} – The color that is used for colored style of this template. Supports hex, rgb, hsl, etc.
  • {{{icon}}} – An icon that will be displayed next to the game name. You only need to enter the name and format of the image, for example, SomeImage.png.
  • {{{external}}} – Whether the link in the link parameter is external.
  • {{{link}}} – The link that will be used.
  • {{{name}}} – The name that will be displayed.

Example

Template:Portal2 (not the actual one)
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
{{Software inline | {{{1|}}} | {{{2|{{{1|}}}}}} | color = #23B1E5 | icon = Portal2-16px.png | link = {{#if:{{{link}}}| {{Langprefix}}Portal 2 }} | name = {{#switch:{{Language}}|#default=Portal 2|ru=Портал 2}} }}

Child Usage

These examples are written directly using this template, since the {{Portal2}}, {{Cs2d}}, {{Hammer}} and other templates do not currently use this template as their base.