Template:Software inline: Difference between revisions
Jump to navigation
Jump to search
Note:Two template styling options (colored text) were left as something that could be used in some situations, but not everywhere.
Note:All links are colored in the color of the visited link, since external links and links to Wikipedia become more difficult to read after visiting. If you have a better color for this situation, simply replace all occurrences of the color #5081D1 in the template code.
(No need for a standard color anymore. Also additional optimization) |
(I think we don't need an option with a dark background. Since the color option will be used rarely, the background+color option will be used even less often. Plus even more optimization and fixes.) |
||
Line 1: | Line 1: | ||
<includeonly><onlyinclude><span | <includeonly><onlyinclude><span dir="{{Text-dir|ltr=ltr|rtl=rtl}}" style="white-space:nowrap">{{#switch:{{{1|}}}|name=|#default={{#if:{{{icon|}}}|<span style="position:relative; top:-1px; user-select:none; line-height:{{#if:{{{icon size|}}}|{{{icon size}}}px;height:{{{icon size}}}|16px;height:16}}px">[[File:{{{icon}}}|{{#if:{{{icon size|}}}|{{{icon size}}}|16}}px|link={{#switch: {{#titleparts:{{{link|}}}|1|1}}|Ext={{#titleparts:{{{link|}}}||2}}|#default={{{link|}}}}}]]</span>{{#switch:{{{1|}}}|icon=|#default=<span style="user-select:none"> </span>}}}}}}{{#switch:{{{1|}}}|icon=|#default=<span style="line-height:16px; {{#switch:{{{2|}}}|colored=font-weight:bold}}">{{#switch:{{#titleparts:{{{link|}}}|1|1}}|={{{name|}}}|Ext=[{{#titleparts:{{{link|}}}||2}} <span style="{{#switch:{{{2|}}}|colored=color:{{{color|#5081D1}}}}}">{{{name|}}}</span>]|#default=[[:{{{link|}}}|<span style="{{#switch:{{{2|}}}|colored=color:{{{color|#5081D1}}}}}">{{{name|}}}</span>]]}}<wbr></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 59: | Line 59: | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal2| | {{td| {{Code|<nowiki>{{Portal2|colored}}</nowiki>}} }} | ||
{{td| This is {{Software inline| | {{td| This is {{Software inline|colored|colored|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Link with | {{td| Link with colored text. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal2 | {{td| {{Code|<nowiki>{{Portal2|name|colored}}</nowiki>}} }} | ||
{{td| This is {{Software inline|name|colored|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }} | |||
{{td| Link without icon and with colored text. }} | |||
{{td| This is {{Software inline|name| | |||
{{td| Link without icon and with | |||
}} | }} | ||
{{tr| | {{tr| | ||
Line 84: | Line 74: | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Hl2| | {{td| {{Code|<nowiki>{{Hl2|colored|mode=short}}</nowiki>}} }} | ||
{{td| This is {{Software inline| | {{td| This is {{Software inline|colored|colored|color=#FFCC14|icon=Hl2-16px.png|link=Half-Life 2|name={{#switch:short|short=HL2|#default=Half-Life 2}} }}! }} | ||
{{td| Link with | {{td| Link with colored text and custom display mode “short”. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Hammer| | {{td| {{Code|<nowiki>{{Hammer|colored}}</nowiki>}} }} | ||
{{td| This is {{Software inline| | {{td| This is {{Software inline|colored|colored|color=#6165AD|icon=Hammer-16px.png|link=Valve Hammer Editor|name=Hammer}}! }} | ||
{{td| Link with | {{td| Link with colored text. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
Line 97: | Line 87: | ||
{{td| This is {{Software inline|color=#6165AD|icon=Hammer-16px.png|link=Valve Hammer Editor|name={{#switch:full|full=Valve Hammer Editor|#default=Hammer}} }}! }} | {{td| This is {{Software inline|color=#6165AD|icon=Hammer-16px.png|link=Valve Hammer Editor|name={{#switch:full|full=Valve Hammer Editor|#default=Hammer}} }}! }} | ||
{{td| Link with custom display mode “full”. }} | {{td| Link with custom display mode “full”. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
Line 119: | Line 104: | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal2| | {{td| {{Code|<nowiki>{{Portal2|colored|link=games}}</nowiki>}} }} | ||
{{td| This is {{Software inline| | {{td| This is {{Software inline|colored|colored|color=#23B1E5|icon=Portal2-16px.png|link={{#switch:games|games=Category:Portal 2 engine branch games|#default=Portal 2}}|name=Portal 2}}! }} | ||
{{td| Custom link leading to a place defined by the word “games” (In this case, this is a link to “Category:Portal 2 engine branch games”). }} | {{td| Custom link leading to a place defined by the word “games” (In this case, this is a link to “Category:Portal 2 engine branch games”). }} | ||
}} | }} | ||
Line 134: | Line 119: | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal2| | {{td| {{Code|<nowiki>{{Portal2|colored|icon size=32}}</nowiki>}} }} | ||
{{td| This is {{Software inline| | {{td| This is {{Software inline|colored|colored|icon size=32|color=#23B1E5|icon=Portal2-16px.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Link with | {{td| Link with colored text and custom icon size. }} | ||
}} | }} | ||
{{tr| | {{tr| |
Revision as of 02:20, 21 June 2024
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).
- {{{name}}} – The name that will be displayed. It is recommended to use the String template in this parameter to add a name translation.
- {{{link}}} – The link that will be used. It is recommended to combine this parameter with #switch: if you want to add the ability to specify more than one link. For example, links to categories related to this game.
- {{{icon}}} – An icon that will be displayed next to the game name. Also clickable. You only need to enter the name and format of the image, for example, SomeImage.png
- {{{icon size}}} – icon size (default is 16px). Only accepts px. In this parameter the same parameter is specified for the ability to specify the size of the icon in child templates.
- {{{color}}} – The color that is used for certain styles of this template. Supports hex, rgb, hsl, etc.
Example
Child Usage
These examples are written directly using this template, since the {{Portal2}}, {{Hl2}}, {{Hammer}} and other templates do not currently use this template as their base.
Code | Result | Description |
---|---|---|
{{Portal2}} | This is ![]() |
Regular internal link. |
{{Idtech3}} | This is ![]() |
Link to Wikipedia article. |
{{Cs2d}} | This is ![]() |
External link. |
{{Portal2|name}} | This is Portal 2 |
Link without icon. |
{{Portal2|icon}} | This is ![]() |
Clickable Icon. |
{{Portal2|colored}} | This is ![]() |
Link with colored text. |
{{Portal2|name|colored}} | This is Portal 2 |
Link without icon and with colored text. |
{{Hl2|mode=short}} | This is ![]() |
Link with custom display mode “short”. |
{{Hl2|colored|mode=short}} | This is ![]() |
Link with colored text and custom display mode “short”. |
{{Hammer|colored}} | This is ![]() |
Link with colored text. |
{{Hammer|mode=full}} | This is ![]() |
Link with custom display mode “full”. |
{{Hammer|mode=old}} | This is ![]() |
Link with custom display mode “old”. |
{{Hammer|mode=3x}} | This is ![]() |
Link with custom display mode “3x”. |
{{Portal2|link=category}} | This is ![]() |
Custom link leading to a place defined by the word “category” (In this case, this is a link to “Category:Portal 2”). |
{{Portal2|colored|link=games}} | This is ![]() |
Custom link leading to a place defined by the word “games” (In this case, this is a link to “Category:Portal 2 engine branch games”). |
{{Portal2|link=}} | This is ![]() |
No Link and without style. |
{{Portal2|icon size=32}} | This is ![]() |
Link with custom icon size. |
{{Portal2|colored|icon size=32}} | This is ![]() |
Link with colored text and custom icon size. |
{{Portal2|icon|icon size=24}} | This is ![]() |
Icon with custom size. |