Template:Year: Difference between revisions

From Absit Omen Lexicon
m (Protected "Template:Year": Complex Wiki or Template Coding ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
mNo edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch: {{Year/calc|{{{1}}}|{{{2}}}}}
<includeonly>{{#invoke:year|year}}</includeonly><noinclude>
| 1= {{#ifeq: {{{4|}}} | cat | [[Category:First Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} First Year{{!}}{{name}}]]|First Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
{{Documentation}}
| 2= {{#ifeq: {{{4|}}} | cat | [[Category:Second Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Second Year{{!}}{{name}}]]|Second Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
</noinclude>
| 3= {{#ifeq: {{{4|}}} | cat | [[Category:Third Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Third Year{{!}}{{name}}]]|Third Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 4= {{#ifeq: {{{4|}}} | cat | [[Category:Fourth Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Fourth Year{{!}}{{name}}]]|Fourth Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}}}}
| 5= {{#ifeq: {{{4|}}} | cat | [[Category:Fifth Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Fifth Year{{!}}{{name}}]]|Fifth Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 6= {{#ifeq: {{{4|}}} | cat | [[Category:Sixth Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Sixth Year{{!}}{{name}}]]|Sixth Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
| 7= {{#ifeq: {{{4|}}} | cat | [[Category:Seventh Year{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}}{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Seventh Year{{!}}{{name}}]]|Seventh Year{{#if: {{{3|}}}|&nbsp;{{House|{{{3}}}}}|}} }}
|    {{#ifexpr:{{Year/calc|{{{1}}}|{{{2}}}}}>7|{{#ifeq: {{{4|}}} | cat | [[Category:Class of {{Year/grad|{{{1}}}|{{{2}}}}}{{!}}{{name}}]]{{#if: {{{3|}}}|[[Category:{{House|{{{3}}}}} Alumni{{!}}{{name}}]]|[[Category:Unknown House or School]]}}[[Category: {{House|{{{3}}}}} Class of {{Year/grad|{{{1}}}|{{{2}}}}}{{!}}{{name}}]]|{{#if: {{{3|}}}|{{House|{{{3}}}}}}} Class of {{Year/grad|{{{1}}}|{{{2}}}}} }} }} }}</includeonly><noinclude>
{{Year/doc}}
 
[[Category:Templates]]</noinclude>

Latest revision as of 01:38, 16 July 2021

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

This template returns the current year of a student, or the year a non-student character graduated. It uses the Current Date Module to determine the current date. Enter the Birth year as the first value and the birth month as the second value.

Syntax
{{Year|birthYear|birthmonth}}
The Year template can also take a Hogwarts House specifier. g=Gryffindor, r=Ravenclaw, h=Hufflepuff, s=Slytherin. Also d=Durmstrang Institute, b=Beauxbatons Academy, w=Salem Witches Institute
{{Year|birthYear|birthmonth|firstletterofhouse}}
Example
{{Year|2006|8|g}} returns "pre-school-aged child"
{{Year|1997|8|g}} returns "Gryffindor Graduate (Class of 2015)"
{{Year|1998|3}} returns "Graduate (Class of 2016)"
{{Year|1994|9}} returns "Graduate (Class of 2013)"
{{Year|1990|06}} returns "Graduate (Class of 2008)"
{{Year|1981|7|r}} returns "Ravenclaw Graduate (Class of 1999)"
{{Year|1960|11}} returns "Graduate (Class of 1979)"

The year template invokes Module:Year. It also makes use of Module:Date and Module:CurrentDate to set the date by which the year is calculated.

The above documentation is transcluded from Template:Year/doc. (edit | history)
Please add categories and interwikis to the /doc subpage. Subpages of this template.