Difference between revisions of "Template:Canada elections/navigate next"

From blackwiki
Jump to navigation Jump to search
imported>117Avenue
(replacing template that broke this one)
imported>Primefac
m (Protected "Template:Canada elections/navigate next": semi-protection of high-usage templates to combat systematic vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed acce...)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{main other|{{#ifeq:{{str endswith|{{PAGENAME}}| {{{1}}} Canadian federal election}}|yes|{{#ifexist:{{trunc|{{PAGENAME}}|{{#titleparts:{{str find long/logic|{{PAGENAME}}| {{{1}}} Canadian federal election|{{str len|* {{{1}}} Canadian federal election*}}-2}}-1|1}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian federal election|&nbsp;&nbsp;&nbsp;[[{{trunc|{{PAGENAME}}|{{#titleparts:{{str find long/logic|{{PAGENAME}}| {{{1}}} Canadian federal election|{{str len|* {{{1}}} Canadian federal election*}}-2}}-1|1}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian federal election|→]]}}|{{#ifeq:{{str endswith|{{PAGENAME}}| {{{1}}}}}|yes|{{#ifexist:{{trunc|{{PAGENAME}}|{{str find long|{{PAGENAME}}| {{{1}}}}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}|&nbsp;&nbsp;&nbsp;[[{{trunc|{{PAGENAME}}|{{str find long|{{PAGENAME}}| {{{1}}}}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}|→]]}}|{{#ifeq:{{PAGENAME}}|{{ordinal|{{Canada elections/federal election|{{{1}}}}}}} Canadian Parliament|{{#ifexist:{{ordinal|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian Parliament|&nbsp;&nbsp;&nbsp;[[{{ordinal|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian Parliament|→]]}}|{{#ifeq:{{PAGENAME}}|{{ordinal|{{#expr:{{Canada elections/federal election|{{{1}}}}}-1}}}} Canadian Parliament|{{#ifexist:{{ordinal|{{Canada elections/federal election|{{{1}}}}}}} Canadian Parliament|&nbsp;&nbsp;&nbsp;[[{{ordinal|{{Canada elections/federal election|{{{1}}}}}}} Canadian Parliament|→]]}}}}}}}}}}|{{#ifexist:{{str rep|{{FULLPAGENAME}}|{{{1}}}|{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}}}|&nbsp;&nbsp;&nbsp;[[{{str rep|{{FULLPAGENAME}}|{{{1}}}|{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}}}|→]]}}}}<noinclude>
+
{{main other|{{#ifeq:{{str endswith|{{PAGENAME}}| {{{1}}} Canadian federal election}}|yes|{{#ifexist:{{trunc|{{PAGENAME}}|{{str find|{{PAGENAME}}| {{{1}}} Canadian federal election}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian federal election|&nbsp;&nbsp;&nbsp;[[{{trunc|{{PAGENAME}}|{{str find|{{PAGENAME}}| {{{1}}} Canadian federal election}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian federal election|→]]}}|{{#ifeq:{{str endswith|{{PAGENAME}}| {{{1}}}}}|yes|{{#ifexist:{{trunc|{{PAGENAME}}|{{str find|{{PAGENAME}}| {{{1}}}}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}|&nbsp;&nbsp;&nbsp;[[{{trunc|{{PAGENAME}}|{{str find long|{{PAGENAME}}| {{{1}}}}}}}{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}|→]]}}|{{#ifeq:{{PAGENAME}}|{{ordinal|{{Canada elections/federal election|{{{1}}}}}}} Canadian Parliament|{{#ifexist:{{ordinal|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian Parliament|&nbsp;&nbsp;&nbsp;[[{{ordinal|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}} Canadian Parliament|→]]}}|{{#ifeq:{{PAGENAME}}|{{ordinal|{{#expr:{{Canada elections/federal election|{{{1}}}}}-1}}}} Canadian Parliament|{{#ifexist:{{ordinal|{{Canada elections/federal election|{{{1}}}}}}} Canadian Parliament|&nbsp;&nbsp;&nbsp;[[{{ordinal|{{Canada elections/federal election|{{{1}}}}}}} Canadian Parliament|→]]}}}}}}}}}}|{{#ifexist:{{str rep|{{FULLPAGENAME}}|{{{1}}}|{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}}}|&nbsp;&nbsp;&nbsp;[[{{str rep|{{FULLPAGENAME}}|{{{1}}}|{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|{{{1}}}}}+1}}}}}}|→]]}}}}<noinclude>
 
{{Documentation|Template:Canada elections/federal election/doc}}
 
{{Documentation|Template:Canada elections/federal election/doc}}
 
[[Category:Canadian federal election year templates|Navigate Next]]
 
[[Category:Canadian federal election year templates|Navigate Next]]
 
</noinclude>
 
</noinclude>

Latest revision as of 00:28, 19 January 2018

Template documentation[view] [edit] [history] [purge]

{{Canada elections/federal election}}, {{Canada elections/federal election year}}, {{Canada elections/navigate previous}}, and {{Canada elections/navigate next}} are intended to be used in the Canadian federal election navigational boxes, (for example Template:Canadian federal election, 2011A,) however they may have other uses.

Usage

Examples

Election numbers and years

  • Year to number.

{{Canada elections/federal election|1958}} produces 24

{{Canada elections/federal election|1962}} produces 25

  • Number to year.

{{Canada elections/federal election year|25}} produces 1962

{{Canada elections/federal election year|26}} produces 1963

  • There and back.

{{#expr:{{Canada elections/federal election|1963}}+1}} produces 27

{{Ordinal|{{#expr:{{Canada elections/federal election|1965}}+1}}}} produces Template:Ordinal

{{Canada elections/federal election year|{{#expr:{{Canada elections/federal election|1968}}+1}}}} produces 1972

Invalid parameters

  • Numbers out of range
    • {{Canada elections/federal election|1973}}
    • {{Canada elections/federal election|29}}
    • {{Canada elections/federal election year|029}}
    • {{Canada elections/federal election year|1974}}
  • Text
    • {{Canada elections/federal election|Foo}}
    • {{Canada elections/federal election year|Foo}}
    • {{Canada elections/navigate previous|Foo}}
    • {{Canada elections/navigate next|Foo}}

Linking to articles ending in "Canadian federal election"

{{Canada elections/navigate previous|1979}} produces [[Progressive Conservative Party of Canada candidates, 1974 Canadian federal election|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|1979}} produces &nbsp;&nbsp;&nbsp;[[Progressive Conservative Party of Canada candidates, 1980 Canadian federal election|→]]

{{Canada elections/navigate previous|1980}} produces [[Liberal Party of Canada candidates, 1974 Canadian federal election|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|1980}} produces &nbsp;&nbsp;&nbsp;[[Liberal Party of Canada candidates, 1984 Canadian federal election|→]]

Linking to Parliaments

{{Canada elections/navigate previous|1993}} produces [[34th Canadian Parliament|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|1993}} produces &nbsp;&nbsp;&nbsp;[[36th Canadian Parliament|→]]

{{Canada elections/navigate previous|1997}} produces [[34th Canadian Parliament|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|1997}} produces &nbsp;&nbsp;&nbsp;[[36th Canadian Parliament|→]]

Linking to articles ending in the year

{{Canada elections/navigate previous|2000}} produces [[Canadian federal election, 1997|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|2000}} produces &nbsp;&nbsp;&nbsp;[[Canadian federal election, 2004|→]]

{{Canada elections/navigate previous|2004}} produces [[Results of the Canadian federal election, 2000|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|2004}} produces &nbsp;&nbsp;&nbsp;[[Results of the Canadian federal election, 2006|→]]

{{Canada elections/navigate previous|2006}} produces [[Timeline of the Canadian federal election, 2004|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|2006}} produces &nbsp;&nbsp;&nbsp;[[Timeline of the Canadian federal election, 2008|→]]

Linking to pages outside the mainspace

{{Canada elections/navigate previous|2008}} produces [[Template:Canadian federal election, 2006A|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|2008}} produces &nbsp;&nbsp;&nbsp;[[Template:Canadian federal election, 2011A|→]]

{{Canada elections/navigate previous|2011}} produces [[Template:Canadian federal election, 2008|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|2011}} produces &nbsp;&nbsp;&nbsp;[[Template:Canadian federal election, 2015|→]]

{{Canada elections/navigate previous|2015}} produces [[User:Example/Target ridings in 2011/NDP|←]]&nbsp;&nbsp;&nbsp;

{{Canada elections/navigate next|2015}} produces &nbsp;&nbsp;&nbsp;[[User:Example/Target ridings in 2019/NDP|→]]

{{Canada elections/navigate previous|2015}} looking for the existence of 2011er:Example/Target ridings in the Canadian federal election, 2015.

Invalid combinations

  • Years do not match.

{{Canada elections/navigate previous|1980}} on Canadian federal election, 1979

{{Canada elections/navigate next|1979}} on Canadian federal election, 1980

  • Page does not exist.

{{Canada elections/navigate previous|2004}} on Conservative Party of Canada candidates, 2004 Canadian federal election

{{Canada elections/navigate next|2000}} on Progressive Conservative Party of Canada candidates, 2000 Canadian federal election

  • No year in page name.

{{Canada elections/navigate previous|2004}} on Paul Martin

{{Canada elections/navigate next|2006}} on Stephen Harper

  • Year out of range.

{{Canada elections/navigate previous|2009}} on Canadian federal by-elections, 2009

{{Canada elections/navigate next|2014}} on Canadian federal election, 2014