Difference between revisions of "Template:TH"

From QWiki
m (Test centering)
m (Reworked centering)
Line 1: Line 1:
<includeonly>{{#if:{{{center|}}}|<div><div class="infobox-cell-2 infobox-description">{{{1}}}</div></div>|<div style="font-size:100%; line-height:-10px;"><div class="th-mono" style="float:left;width:50%;text-align:left;">''{{{1|}}}''</div>}} <div style="float:right;width:50%;text-align:left;">{{#if:{{{flag|}}}|<span style="white-space:nowrap;vertical-align:baseline;">{{flag/{{lc:{{{flag}}}}}}}&nbsp;</span>|}}{{#if:{{{2|}}}|{{#ifeq:{{{no-link|}}}|true|{{{2|}}}|[[{{{link|{{{2|}}}}}}|{{{2|}}}]]}}}}{{#if:{{{3|}}}|{{#switch:{{lc:{{{3|}}}}}
+
<includeonly>{{#if:{{{center|}}}|<div><div class="infobox-cell-2 infobox-description">{{{1}}}</div></div><div><div class="infobox-cell-2">{{#if:{{{flag|}}}|<span style="white-space:nowrap;vertical-align:baseline;">{{flag/{{lc:{{{flag}}}}}}}&nbsp;</span>|}}{{#if:{{{2|}}}|{{#ifeq:{{{no-link|}}}|true|{{{2|}}}|[[{{{link|{{{2|}}}}}}|{{{2|}}}]]}}}}{{#if:{{{3|}}}|{{#switch:{{lc:{{{3|}}}}}
 +
|r = '''Retired'''
 +
|teamless= '''Teamless'''
 +
|inactive= &nbsp;''(Inactive)''
 +
|retired = '''Retired'''
 +
|analyst = &nbsp;''(Analyst)''
 +
|coach = &nbsp;''(Coach)''
 +
|stand-in = &nbsp;''(Stand-in)''
 +
|backup = &nbsp;''(Backup)''
 +
|substitute = &nbsp;''(Substitute)''
 +
|manager = &nbsp;''(Manager)''
 +
|trial= &nbsp;''(Trial)''
 +
|tryout= &nbsp;''(Tryout)''
 +
|#DEFAULT=&nbsp;
 +
}}}}</div></div>|<div style="font-size:100%; line-height:-10px;"><div class="th-mono" style="float:left;width:50%;text-align:left;">''{{{1|}}}''</div><div style="float:right;width:50%;text-align:left;">{{#if:{{{flag|}}}|<span style="white-space:nowrap;vertical-align:baseline;">{{flag/{{lc:{{{flag}}}}}}}&nbsp;</span>|}}{{#if:{{{2|}}}|{{#ifeq:{{{no-link|}}}|true|{{{2|}}}|[[{{{link|{{{2|}}}}}}|{{{2|}}}]]}}}}{{#if:{{{3|}}}|{{#switch:{{lc:{{{3|}}}}}
 
|r = '''Retired'''
 
|r = '''Retired'''
 
|teamless= '''Teamless'''
 
|teamless= '''Teamless'''

Revision as of 10:31, 20 March 2023

Documentation (view - edit)

Usage

The variables are:

|1=
The first variable entered is the date, it will be italicized.
|2=
The second variable is the team name, it will be linked.
|3=
Third variable must be any of the values to the left in this list:

r = Retired
|retired = Retired
|teamless = Teamless
|inactive = (Inactive)
|analyst = (Analyst)
|coach = (Coach)
|stand-in = (Stand-in)
|backup = (Backup)
|substitute = (Substitute)
|manager = (Manager)
|trial = (Trial)
|tryout = (Tryout)

|flag=
Defaulting to none, use the 2 letter iso code for the country to show flag.
|link=
If the name of the team and the page name on QWiki differ, use this variable to set the page link.
|no-link=
If the team listed does not have a page on QWiki, set this variable to "true".
|center=
If center is set to anything, the year/date will move closer to center.

Example

{{TH|2015 - '''Present'''|Felia|link=Felia020}}
{{TH|2012 – 2013|The Viper Squad|inactive}}
{{TH|2003|Chopstick Ninjas|flag=dk|center=y}}
{{TH|2011|Zetor}}

Returns these layouts.

{{#if:|
2015 - Present
|
2015 - Present
{{#if:|
2012 – 2013
The Viper Squad (Inactive)
|
2012 – 2013
The Viper Squad (Inactive)
{{#if:y|
2003
|
{{#if:|
2011
|
2011