Template:Software inline: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
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 {{#ifeq:{{padleft:|1|{{bidi:{{int:edit}}}}}}|&#x202B;|dir=rtl}} style="white-space:nowrap; {{#ifeq:{{{2}}}|styled|padding:2px 3px; border-radius:3px; background:#00000030; font-weight:bold}}">{{#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:{{{elink|}}}|[{{{link}}} <span {{#ifeq:{{{2}}}|styled|style="color:{{{color|#5081D1}}}"}}>{{{name|}}}</span>]|[[:{{{link}}}|<span {{#ifeq:{{{2}}}|styled|style="color:{{{color|#5081D1}}}"}}>{{{name|}}}</span>]]}}|<span {{#ifeq:{{{2}}}|styled|style="color:{{{color|#5081D1}}}"}}>{{{name}}}</span>}}}}</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 15: Line 15:
| 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 53: Line 53:
}}
}}
{{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 76:
  {{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. }}
}}
}}
}}
}}

Revision as of 07:37, 11 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.
  • {{{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.