Difference between revisions of "Template:TeamAbbr"

From QWiki
m
m (Removed mix-blend-mode (resulting in grayscale flags when listing multiple players with flags))
 
(31 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
Starting with checking if the hidden sort variable is set if so it'll go into a switch to output the right variable as hidden.
 
-->{{#if:{{{hs|}}}|{{HiddenSort|{{#switch:{{lc:{{{hs}}}}}
 
    |race = {{{race|}}}
 
    |name = {{{1|}}}
 
    |flag = {{{flag/}}}
 
    |{{{hs}}}}}}}}}<!--
 
  
Checking to see if flag variable is set and if so using an image link to display it.
+
If flag is set - use an image link to display it.
-->{{#if:{{{flag|}}}|<span style="white-space:nowrap;">{{flag/{{lc:{{{flag}}}}}}}&nbsp;</span>|<span style="white-space:nowrap;">{{flag/tbd}}&nbsp;</span>}}<!--
+
-->{{#if:{{{flag|}}}|<span style="white-space:nowrap;vertical-align:baseline;">{{flag/{{lc:{{{flag}}}}}}}&nbsp;</span>|}}<!--
  
Checking if there is a link= variable. If there is use it, if not load the correct link from the player link list.
+
Display team name. If |gray= is set to anything, text will show in gray.
--><span style="white-space: pre">{{#if:{{{link|}}}|{{#switch: {{{link}}}
+
-->{{#switch: {{{link|}}}
|false={{{1}}}
+
|false={{#ifeq:{{{gray|}}}|true|<span style="white-space:pre;vertical-align:baseline;color:#888;">{{{1|}}}|<span style="white-space:pre;vertical-align:baseline;color:#333;">{{{1|}}}}}
|{{#if:{{{2|}}}|{{abbr|{{{1|}}}|{{{2|}}}}}|{{abbr|{{{1}}}|{{{2}}}}}}}}}</span><!--
+
|true=[[{{{1|}}}]]
 +
|{{{1|}}} }}<!--
  
</includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude>
+
 
 +
Check if rows is set:
 +
-->{{#if:{{{rows|}}}|{{#switch: {{{rows}}}
 +
|2=<span style="white-space: pre;font-size:70%;color:#888;vertical-align:top;><br />{{{2}}}</span>
 +
|#default=<span style="white-space:pre;font-size:70%;color:#888;margin-left:8px;vertical-align:baseline;">{{{2}}}</span>}}|<span style="white-space:pre;font-size:70%;color:#888;margin-left:8px;vertical-align:baseline;">{{{2}}}</span>}}</includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude>

Latest revision as of 20:06, 3 May 2022

Documentation (view - edit)

This template is used to display a team and then its players on one (comma separated) line together.

Russia RussiaBilly The Kid, gLAd, Zeppski, Quake, Bulat, Gorgoroth, NLK, SS, Max Power

Use

|=
The name of the team. By default, it will not be linked.
|link=true
If set, the name of the team is linked.
|gray=
Changes color of team name to lighter gray (does not work if team is linked).
|flag=
Country flag using two letter ISO code. Use tbd for TBD. Leave empty to hide flag entirely.
|rows=
If set to 2, player names will move under team.
|(after last pipe)=
Anything entered here will display to the right of the team.
Note: When listing players, please use comma followed by a space (, ) between each player.
By default players are printed with small, light gray text, but this template supports the us of {{player}} so that individual players can have flag, link or abbr.

More uses

Example 1

On 2 rows, with full use of {{player}} for each name:

{{TeamAbbr|Russia|flag=ru|rows=2|{{player|Billy The Kid|flag=ru}}, {{player|gLAd|flag=ru}}, {{player|Zeppski|flag=ru|link=Zepp}}, {{player|Quake|flag=ru}}, {{player|Bulat|flag=ru}}, {{player|Gorgoroth|flag=ru}}, {{player|nlk|flag=ru}}, {{player|SS|flag=ru}}, {{player|Max Power|flag=ru}}}}

Gives us:
Russia Russia
Russia Billy The Kid, Russia gLAd, Russia Zeppski, Russia Quake, Russia Bulat, Russia Gorgoroth, Russia nlk, Russia SS, Russia Max Power

Example 2

Within {{GroupTableSlot}}:

{{GroupTableSlot| {{TeamAbbr|Australia|flag=au|Yeti, HarlsoM, dracs, blindcant, swoop}} |place=2 |win_m=2 |lose_m=3 |win_g=4 |lose_g=7 |diff=-3 |bg=}}
GroupTableStart
2. Australia AustraliaYeti, HarlsoM, dracs, blindcant, swoop 2-3 4-7 -3

Copy/Paste

{{TeamAbbr|Teamname|flag=tbd|player1, player2, player3, player4}}