Difference between revisions of "Template:Active"

From QBWiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<includeonly>{{#if:{{{2|}}}
 
<includeonly>{{#if:{{{2|}}}
 
<!----->|{{#iferror:{{#expr:{{{2}}}-{{{1}}}}}
 
<!----->|{{#iferror:{{#expr:{{{2}}}-{{{1}}}}}
 +
<!-----><!----->|Error in the input
 
<!-----><!----->|{{#switch:{{#expr:{{{2}}}-{{{1}}}}}
 
<!-----><!----->|{{#switch:{{#expr:{{{2}}}-{{{1}}}}}
 
<!-----><!-----><!----->|1=[[Category:Players active in {{{1}}}]]
 
<!-----><!-----><!----->|1=[[Category:Players active in {{{1}}}]]
Line 352: Line 353:
 
<!-----><!-----><!----->[[Category:Players active in {{{2}}}]]
 
<!-----><!-----><!----->[[Category:Players active in {{{2}}}]]
 
<!-----><!-----><!----->|#default=[[Category:Players active in {{{1}}}]]
 
<!-----><!-----><!----->|#default=[[Category:Players active in {{{1}}}]]
<!-----><!----->}}|Error in the input}}
+
<!-----><!----->}}}}
 
<!----->|{{#if:{{{1|}}}|[[Category:Players active in {{{1}}}]]|No years entered}}
 
<!----->|{{#if:{{{1|}}}|[[Category:Players active in {{{1}}}]]|No years entered}}
 
}}</includeonly><noinclude>Shorthand for adding active years for player.
 
}}</includeonly><noinclude>Shorthand for adding active years for player.

Revision as of 16:50, 17 March 2021

Shorthand for adding active years for player.

  • {{{1}}} - start year (inclusive)
  • {{{2}}} - end year (inclusive; optional)

End year can be up to 25 years after start year.

Usage:

input output
{{active|2005}} [[Category: Players active in 2005]]
{{active|2005|2005}} [[Category: Players active in 2005]]
{{active|2005|2004}} [[Category: Players active in 2005]]
{{active|2005|2006}} [[Category: Players active in 2005]] [[Category: Players active in 2006]]
{{active|2005|2007}} [[Category: Players active in 2005]] [[Category: Players active in 2006]] [[Category: Players active in 2007]]
{{active|2005|2008}} [[Category: Players active in 2005]] [[Category: Players active in 2006]] [[Category: Players active in 2007]] [[Category: Players active in 2008]]