Template:Advanced link: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><onlyinclude>< | <includeonly><onlyinclude><b 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}}}|{{{icon size|x16}}}px|link={{{link|}}}]]</span>}}{{#ifeq:{{{1|}}}|icon||{{#ifeq:{{{1|}}}|text|{{{name|}}}|{{#if:{{{external|}}}|<span class="plainlinks">[{{{link}}} {{#ifeq:{{{1|}}}|styled|<span style="color:{{{color|#3C78D2}}}">{{{name|}}}</span>|{{{name|}}}}}]</span>|[[:{{{link}}}|{{#ifeq:{{{1|}}}|styled|<span style="color:{{{color|#3C78D2}}}">{{{name|}}}</span>|{{{name|}}}}}]]}}}}}}</b></onlyinclude></includeonly> | ||
This template is an improved and simplified version of template | This template is an improved and simplified version of template {{T|Software}}. | ||
== Child Templates Usage == | |||
== Child Usage == | |||
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. | 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 | ||
Line 21: | Line 12: | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal 2}}</nowiki>}} }} | {{td| {{Code|<nowiki>{{Portal 2}}</nowiki>}} }} | ||
{{td| This is {{Software inline|color=#23B1E5|icon=Portal2 | {{td| This is {{Software inline|color=#23B1E5|icon=Portal2 icon.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Link with icon. }} | {{td| Link with icon. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal 2|styled}}</nowiki>}} }} | {{td| {{Code|<nowiki>{{Portal 2|styled}}</nowiki>}} }} | ||
{{td| This is {{Software inline|styled|color=#23B1E5|icon=Portal2 | {{td| This is {{Software inline|styled|color=#23B1E5|icon=Portal2 icon.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Colored link. }} | {{td| Colored link. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal 2|icon}}</nowiki>}} }} | {{td| {{Code|<nowiki>{{Portal 2|icon}}</nowiki>}} }} | ||
{{td| This is {{Software inline|icon|color=#23B1E5|icon=Portal2 | {{td| This is {{Software inline|icon|color=#23B1E5|icon=Portal2 icon.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Clickable Icon. }} | {{td| Clickable Icon. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal 2|link}}</nowiki>}} }} | {{td| {{Code|<nowiki>{{Portal 2|link}}</nowiki>}} }} | ||
{{td| This is {{Software inline|link|color=#23B1E5|icon=Portal2 | {{td| This is {{Software inline|link|color=#23B1E5|icon=Portal2 icon.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Link without icon. }} | {{td| Link without icon. }} | ||
}} | }} | ||
{{tr| | {{tr| | ||
{{td| {{Code|<nowiki>{{Portal 2|text}}</nowiki>}} }} | {{td| {{Code|<nowiki>{{Portal 2|text}}</nowiki>}} }} | ||
{{td| This is {{Software inline|text|color=#23B1E5|icon=Portal2 | {{td| This is {{Software inline|text|color=#23B1E5|icon=Portal2 icon.png|link=Portal 2|name=Portal 2}}! }} | ||
{{td| Plain text. }} | {{td| Plain text. }} | ||
}} | }} | ||
Line 55: | Line 46: | ||
}} | }} | ||
}} | }} | ||
== Description == | |||
{| class="standard-table" | |||
|- | |||
! Parameter | |||
! Description | |||
|- | |||
| {{Code|{{P| {{Param||}} }}}} | |||
| The first parameter specifies the template display format: | |||
* If the value is empty, the standard option will be displayed: an icon with a link. | |||
* {{Code|icon}} – Displays only the icon. | |||
* {{Code|link}} – Displays only the link. | |||
* {{Code|text}} – Displays link text only. | |||
* {{Code|styled}} – Displays an icon and link colored in the color specified by the {{Param|color}} parameter. | |||
When used in child templates, you must specify {{Code|{{Param||}}}} so that you can change the modes when using them. | |||
|- | |||
| {{Code|{{P| color | <color>}}}} | |||
| Used to colorize a link in {{Code|styled}} mode. Default value is {{Color|r=60|g=120|b=210}}. | |||
|- | |||
| {{Code|{{P| icon | Example.png}}}} | |||
| The icon that will be displayed next to the link. You only need to specify the file name and format, do not enter {{Code|File:}} at the beginning. | |||
|- | |||
| {{Code|{{P| icon size | 32}}}} | |||
| Icon size. Don't include px at the end when specifying a parameter. Default value is {{Code|x16px}}. | |||
|- | |||
| {{Code|{{P| external | 1}}}} | |||
| If this parameter is specified, the value of the {{Param|link}} parameter will be treated as an external link. | |||
|- | |||
| {{Code|{{P| link | Half-Life 2}}}} | |||
| Link. If the {{Param|external}} parameter is specified, this link will be treated as external link. | |||
|- | |||
| {{Code|{{P| name | Portal 2}}}} | |||
| The text that will be displayed for the link. | |||
|} | |||
== Example == | |||
{{CodeBlock|src=Template:Portal 2 ''(not the actual one)''|lines=7|<nowiki>{{Software inline | |||
| {{{1|}}} | |||
| color = #23B1E5 | |||
| icon = Portal2 icon.png | |||
| link = {{Langprefix}}Portal 2 | |||
| name = {{#switch:{{Language}}|#default=Portal 2|Ko=포탈 2}} | |||
}}</nowiki>}} |
Revision as of 07:37, 5 October 2025
This template is an improved and simplified version of template {{Software}}.
Child Templates 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.
Code | Result | Description |
---|---|---|
{{Portal 2}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
Link with icon. |
{{Portal 2|styled}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
Colored link. |
{{Portal 2|icon}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
Clickable Icon. |
{{Portal 2|link}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
Link without icon. |
{{Portal 2|text}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
Plain text. |
{{Idtech3}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
Link to Wikipedia article. |
{{Cs2d}} | This is
![]() This template has been marked as a candidate for speedy deletion because it is unwanted by the author.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself Administrators / Moderators - Remember to check if anything links here and the page history before deleting. |
External link. |
Description
Parameter | Description |
---|---|
| {{{1|}}} | The first parameter specifies the template display format:
When used in child templates, you must specify {{{1|}}} so that you can change the modes when using them. |
| color = <color> | Used to colorize a link in styled mode. Default value is #3C78D2rgb(60,120,210). |
| icon = Example.png | The icon that will be displayed next to the link. You only need to specify the file name and format, do not enter File: at the beginning. |
| icon size = 32 | Icon size. Don't include px at the end when specifying a parameter. Default value is x16px. |
| external = 1 | If this parameter is specified, the value of the {{{link}}} parameter will be treated as an external link. |
| link = Half-Life 2 | Link. If the {{{external}}} parameter is specified, this link will be treated as external link. |
| name = Portal 2 | The text that will be displayed for the link. |