Difference between revisions of "Template:Player"
From QWiki
*>Soma m |
m (css to center flag and name) |
||
(102 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | < | + | <includeonly><!-- |
− | |||
− | <!-- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | + | If flag is set - use an image link to display it. |
− | + | -->{{#if:{{{flag|}}}|<span style="white-space:nowrap;vertical-align:baseline;position:relative;bottom:2px;">{{flag/{{lc:{{{flag}}}}}}} </span>|<span style="white-space:nowrap;vertical-align:baseline;">{{flag/tbd}} </span>}}<!-- | |
− | |||
− | == | + | Checking if there is a link= variable. If there is use it, if not load the correct link from the player link list. If abbr link=abbr, don't link but underline name and show content of abbr= on hover. |
− | + | --><span style="white-space: pre">{{#if:{{{link|}}}| | |
− | + | {{#switch: {{{link}}} | |
− | + | |false={{{1}}} | |
− | + | |true=[[{{{1}}}]] | |
+ | |abbr={{abbr|{{{1|}}}|{{{abbr}}}}} | ||
+ | |[[{{{link}}}|{{{1}}}]]}} | ||
+ | |{{#if:{{{1|TBD}}}|[[{{{1|TBD}}}]]|{{abbr|TBD|To Be Decided}}}} | ||
+ | |[[{{{1}}}]]}}</span><!-- | ||
− | + | </includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude> | |
− | |||
− | < | ||
− | {{ | ||
− | |||
− | [[Category: | ||
− | < | ||
− | |||
− | |||
− |
Latest revision as of 20:37, 14 November 2024
Documentation (view - edit)
Used for players and teams.
Example
This code:
{{player|Hib|flag=fi}} {{player|}} {{player|Kylo Ren|flag=se|link=shaka}} {{player|Team Brazil|flag=br|link=abbr|abbr=GT, mur & lit}} {{player|Ihasnowikipage|flag=us|link=false}}
Returns this:
- Hib - default (name as link)
- TBD - empty player with abbr To Be Decided.
- Kylo Ren - custom link
- Team Brazil - no link but abbreviation (abbr)
- Ihasnowikipage - link=false
Usage
- |
- Name of the player.
- |flag=
- Country flag using two letter ISO code. Leave empty for .
- |link=
- Put a link to another page (not equal to the name), or:
- false
- Player's name is not linked.
- abbr
- Player's name gets a dashed underline, hover to read content. Requires
|abbr=
to be none-empty.
- |abbr=
- Abbreviation text that will display on hover, could be an array of players that a team consist of. Requires
|link=abbr
to be set.