Template:Advanced link: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
<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>
<includeonly><onlyinclude><span style="white-space:nowrap">{{#switch:{{{1|}}}|link|text=|#default=<span style="{{#ifeq:{{{1|}}}|icon||margin-right:.2em;}} position:relative; bottom:.1em; user-select:none">[[File:{{{icon}}}|16px|link={{{link|}}}]]</span>}}{{#ifeq:{{{1|}}}|icon||{{#ifeq:{{{1|}}}|text|{{{name|}}}|{{#if:{{{external|}}}|<span class="plainlinks">[{{{link}}} {{#ifeq:{{{1|}}}|styled|<span style="font-weight:bold; color:{{{color|#5081D1}}}">{{{name|}}}</span>|{{{name|}}}}}]</span>|[[:{{{link}}}|{{#ifeq:{{{1|}}}|styled|<span style="font-weight:bold; color:{{{color|#5081D1}}}">{{{name|}}}</span>|{{{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]].
== Parameters ==
* {{Param}}, {{Param|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).
* {{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|external}} – Whether the link in the link parameter is external.
* {{Param|link}} – The link that will be used.
* {{Param|name}} – The name that will be displayed.


== Example ==
== Example ==
{{CodeBlock|src=Template:Portal2 (not the actual one)|lines=8|<nowiki>{{Software inline
{{CodeBlock|src=Template:Portal 2 ''(not the actual one)''|lines=7|<nowiki>{{Software inline
| {{{1|}}}
| {{{1|}}}
| {{{2|{{{1|}}}}}}
| color = #23B1E5
| color = #23B1E5
| icon = Portal2-16px.png
| icon = Portal2-16px.png
| link = {{#if:{{{link}}}| {{Langprefix}}Portal 2 }}
| link = {{Langprefix}}Portal 2
| name = {{#switch:{{Language}}|#default=Portal 2|ru=Портал 2}}
| name = {{#switch:{{Language}}|#default=Portal 2|ru=Портал 2}}
}}</nowiki>}}
}}</nowiki>}}


== Child Usage ==
== Child Usage ==
These examples are written directly using this template, since the {{T|Portal2}}, {{T|Cs2d}}, {{T|Hammer}} and other templates do not currently use this template as their base.
These examples are written directly using this template, since the {{T|Portal 2}}, {{T|Idtech3}} and {{T|Cs2d}} do not currently use this template as their base.
{{Table
{{Table
| {{tr|
| {{tr|
Line 29: Line 20:
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal 2}}</nowiki>}} }}
  {{td| This is {{Software inline|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| Regular internal link. }}
  {{td| Link with icon. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Idtech3}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal 2|styled}}</nowiki>}} }}
  {{td| This is {{Software inline|color=#D00000|icon=Quake3-16px.png|link=w:Id Tech 3|name=Id Tech 3}}! }}
  {{td| This is {{Software inline|styled|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| Link to Wikipedia article. }}
  {{td| Colored link. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Cs2d}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal 2|icon}}</nowiki>}} }}
  {{td| This is {{Software inline|color=#FFD700|icon=CS2D icon.png|external=1|link=https://store.steampowered.com/app/666220/CS2D|name=CS2D}}! }}
  {{td| This is {{Software inline|icon|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| External link. }}
  {{td| Clickable Icon. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|name}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal 2|link}}</nowiki>}} }}
  {{td| This is {{Software inline|name|name|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|link|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| Link without icon. }}
  {{td| Link without icon. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|icon}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Portal 2|text}}</nowiki>}} }}
  {{td| This is {{Software inline|icon|icon|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|text|color=#23B1E5|icon=Portal2-16px.png|link=|name=Portal 2}}! }}
  {{td| Clickable Icon. }}
  {{td| Plain text. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|styled}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Idtech3}}</nowiki>}} }}
  {{td| This is {{Software inline|styled|styled|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|color=#D00000|icon=Quake3-16px.png|link=w:Id Tech 3|name=Id Tech 3}}! }}
  {{td| Link with styling. }}
  {{td| Link to Wikipedia article. }}
}}
}}
{{tr|
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|name|styled}}</nowiki>}} }}
  {{td| {{Code|<nowiki>{{Cs2d}}</nowiki>}} }}
  {{td| This is {{Software inline|name|styled|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }}
  {{td| This is {{Software inline|color=#FFD700|icon=CS2D icon.png|external=1|link=https://store.steampowered.com/app/666220/CS2D|name=CS2D}}! }}
  {{td| Link without icon and with styling. }}
  {{td| External link. }}
}}
{{tr|
  {{td| {{Code|<nowiki>{{Hammer|styled}}</nowiki>}} }}
  {{td| This is {{Software inline|styled|styled|color=#6165AD|icon=Hammer-16px.png|link=Valve Hammer Editor|name=Hammer}}!}}
  {{td| Link with styling. }}
}}
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|link=}}</nowiki>}} }}
  {{td| This is {{Software inline|color=#23B1E5|icon=Portal2-16px.png|link=|name=Portal 2}}! }}
  {{td| No Link. }}
}}
{{tr|
  {{td| {{Code|<nowiki>{{Portal2|name|link=}}</nowiki>}} }}
  {{td| This is {{Software inline|color=#23B1E5|icon=Portal2-16px.png|name|name|link=|name=Portal 2}}! }}
  {{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 15:11, 26 September 2025

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

Example

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

Child Usage

These examples are written directly using this template, since the {{Portal 2}}, {{Idtech3}} and {{Cs2d}} do not currently use this template as their base.