Template:Advanced link: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
<includeonly><onlyinclude>{{#switch:{{{1|}}}|link|text=|#default=<b style=position:relative;top:-.1em;user-select:none>[[File:{{{icon}}}|{{{icon size|x16}}}px|link={{{link}}}]]{{#ifeq:{{{1|}}}|icon|| }}</b>}}{{#switch:{{{1|}}}|icon=|text={{{name}}}|#default=[{{#if:{{{external}}}|[:{{{link}}}{{!}}|{{{link}}} <nowiki/>}}{{#ifeq:{{{1|}}}|styled|<b style="color:{{{color|#3C78D2}}}">{{{name}}}</b>|{{{name}}}}}{{{external|]}}}]}}</onlyinclude></includeonly> | <includeonly><onlyinclude>{{#switch:{{{1|}}}|link|text=|#default=<b style=position:relative;top:-.1em;user-select:none>[[File:{{{icon}}}|{{{icon size|x16}}}px|link={{{link}}}]]{{#ifeq:{{{1|}}}|icon|| }}</b>}}{{#switch:{{{1|}}}|icon=|text={{{name}}}|#default=[{{#if:{{{external}}}|[:{{{link}}}{{!}}|{{{link}}} <nowiki/>}}{{#ifeq:{{{1|}}}|styled|<b style="color:{{{color|#3C78D2}}}">{{{name}}}</b>|{{{name}}}}}{{{external|]}}}]}}</onlyinclude></includeonly> | ||
This template creates a link with additional features. Primarily created as a basis for other link templates: game templates, program templates and external link templates. | |||
== Child Templates Usage == | == Child Templates Usage == | ||
These examples are written directly using this template, since the {{T|Portal 2}}, {{T|Idtech3}} and {{T| | These examples are written directly using this template, since the {{T|Portal 2}}, {{T|Idtech3}}, {{T|Cs2d}} and {{T|Pcgw}} do not currently use this template as their base. | ||
{{Table | {{Table | ||
| {{tr| | | {{tr| | ||
Line 45: | Line 43: | ||
{{td| {{Code|<nowiki>{{Cs2d}}</nowiki>}} }} | {{td| {{Code|<nowiki>{{Cs2d}}</nowiki>}} }} | ||
{{td| This is {{Advanced link|color=#FFD700|icon=CS2D icon.png|external=|link=https://store.steampowered.com/app/666220/CS2D|name=CS2D}}! }} | {{td| This is {{Advanced link|color=#FFD700|icon=CS2D icon.png|external=|link=https://store.steampowered.com/app/666220/CS2D|name=CS2D}}! }} | ||
{{td| External link. }} | |||
}} | |||
{{tr| | |||
{{td| {{Code|<nowiki>{{Pcgw|Portal 2|Test}}</nowiki>}} }} | |||
{{td| This is {{Advanced link|icon=pcgw icon.png|external=|link=https://www.pcgamingwiki.com/wiki/Portal_2|name=Test}}! }} | |||
{{td| External link. }} | {{td| External link. }} | ||
}} | }} |
Revision as of 10:50, 8 October 2025
This template creates a link with additional features. Primarily created as a basis for other link templates: game templates, program templates and external link templates.
Child Templates Usage
These examples are written directly using this template, since the {{Portal 2}}, {{Idtech3}}, {{Cs2d}} and {{Pcgw}} do not currently use this template as their base.
Code | Result | Description |
---|---|---|
{{Portal 2}} | This is ![]() |
Link with icon. |
{{Portal 2|styled}} | This is ![]() |
Colored link. |
{{Portal 2|icon}} | This is ![]() |
Clickable Icon. |
{{Portal 2|link}} | This is Portal 2! | Link without icon. |
{{Portal 2|text}} | This is Portal 2! | Plain text. |
{{Idtech3}} | This is ![]() |
Link to Wikipedia article. |
{{Cs2d}} | This is ![]() |
External link. |
{{Pcgw|Portal 2|Test}} | This is ![]() |
External link. |
Description
Parameter | Description |
---|---|
| {{{show|}}} | The first parameter specifies the template display format:
When used in child templates, you must specify it as {{{show|}}} (or {{{1|{{{show|}}}}}} if the child template does not use unnamed parameters for anything else) 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 = | If this parameter is specified, the value of the {{{link}}} parameter will be treated as an external link. Do not enter anything into this parameter, it must be left blank, otherwise it will break the template. |
| 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. |