Template:Ardayearheader: Difference between revisions

From Tolkien Gateway
m (Tweaked)
m (Tweaked prepositions of Years of the Trees to make it slightly clearer)
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<table style="float:right; background-color:#f9f9f9; border: 1px solid #aaaaaa;" cellpadding="2" width="350px">
<includeonly><table class="noprint" style="float:right; background-color:#f9f9f9; border: 1px solid #aaaaaa; margin: 0 0 .5em .5em;" cellpadding="2" width="350px">
<tr><td colspan="2" align="center">'''[[Ages of the Children of Ilúvatar]]'''</td></tr>
<tr><td colspan="2" align="center">'''[[Timeline]] of [[Arda]]'''</td></tr>
<tr><td align="right"><small>'''Age:'''</small></td><td><table width="100%"><tr><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|First|'''First Age'''|[[First Age]]}}</td><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Second|'''Second Age'''|[[Second Age]]}}</td><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Third|'''Third Age'''|[[Third Age]]}}</td><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Fourth|'''Fourth Age'''|[[Fourth Age]]}}</td></tr></table></td></tr>
<tr><td align="right"><small>'''Age:'''</small></td><td><table width="100%"><tr><td align="center">{{#switch:{{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}|First Age='''First Age'''|Valian Years|the Lamps|Second Age|Third Age|Fourth Age=[[First Age]]|the Trees={{#ifexpr:{{#explode:{{PAGENAME}}| |-1}}>=1050|'''First Age'''|[[First Age]]}}}}</td><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Second|'''Second Age'''|[[Second Age]]}}</td><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Third|'''Third Age'''|[[Third Age]]}}</td><td align="center">{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Fourth|'''Fourth Age'''|[[Fourth Age]]}}</td></tr></table></td></tr>
<tr><td align="right" style="line-height:1em;"><small>'''Year&nbsp;of<br/>the&nbsp;{{#switch:{{#explode:{{PAGENAME}}| |-2}}|Age=Sun|Trees=Trees|Lamps=Lamps}}:'''</small></td><td>
<tr><td align="right" style="line-height:1em;"><small>'''{{#switch:{{#explode:{{PAGENAME}}| |-2}}|Age=Year&nbsp;of<br/>the&nbsp;Sun|Trees=Year&nbsp;of<br/>the&nbsp;Trees|Lamps=Year&nbsp;of<br/>the&nbsp;Lamps|Years|Year=Valian<br/>Year}}:'''</small></td><td>
<table width="100%"><tr>
<table width="100%"><tr>
<td width="14%" align="center">{{#if:{{#explode:{{{1}}}| |-2}}|[[{{{1}}}|{{#explode:{{{1}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{1|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-3}}}}}|{{{1|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-3}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{2}}}| |-2}}|[[{{{2}}}|{{#explode:{{{2}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{2}}}|{{{2}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{3}}}| |-2}}|[[{{{3}}}|{{#explode:{{{3}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{3}}}|{{{3}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{4}}}| |-2}}|[[{{{4}}}|{{#explode:{{{4}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{4}}}|{{{4}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{5}}}| |-2}}|[[{{{5}}}|{{#explode:{{{5}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{5}}}|{{{5}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{6}}}| |-2}}|[[{{{6}}}|{{#explode:{{{6}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{6}}}|{{{6}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{7}}}| |-2}}|[[{{{7}}}|{{#explode:{{{7}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{7}}}|{{{7}}}]]}}</td>
<td width="14%" align="center">{{#if:{{#explode:{{{1}}}| |-2}}|[[{{{1}}}|{{#explode:{{{1}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{1|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-3}}}}}|{{{1|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-3}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{2}}}| |-2}}|[[{{{2}}}|{{#explode:{{{2}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{2|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-2}}}}}|{{{2|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-2}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{3}}}| |-2}}|[[{{{3}}}|{{#explode:{{{3}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{3|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-1}}}}}|{{{3|{{#expr:{{#explode:{{PAGENAME}}| |-1}}-1}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{4}}}| |-2}}|[[{{{4}}}|{{#explode:{{{4}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{4|{{#explode:{{PAGENAME}}| |-1}}}}}|{{{4|{{#explode:{{PAGENAME}}| |-1}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{5}}}| |-2}}|[[{{{5}}}|{{#explode:{{{5}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{5|{{#expr:{{#explode:{{PAGENAME}}| |-1}}+1}}}}}|{{{5|{{#expr:{{#explode:{{PAGENAME}}| |-1}}+1}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{6}}}| |-2}}|[[{{{6}}}|{{#explode:{{{6}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{6|{{#expr:{{#explode:{{PAGENAME}}| |-1}}+2}}}}}|{{{6|{{#expr:{{#explode:{{PAGENAME}}| |-1}}+2}}}}}]]}}</td><td width="14%" align="center">{{#if:{{#explode:{{{7}}}| |-2}}|[[{{{7}}}|{{#explode:{{{7}}}| |-1}}]]|[[{{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}} {{{7|{{#expr:{{#explode:{{PAGENAME}}| |-1}}+3}}}}}|{{{7|{{#expr:{{#explode:{{PAGENAME}}| |-1}}+3}}}}}]]}}</td>
</tr></table>
</tr></table>
</td></tr>
</td></tr>
</table>
</table>
'''{{PAGENAME}}''' (abbreviated to '''{{#switch:{{#explode:{{PAGENAME}}| |0}}|First=F.A. {{#explode:{{PAGENAME}}| |-1}}|Second=S.A. {{#explode:{{PAGENAME}}| |-1}}|Third=T.A. {{#explode:{{PAGENAME}}| |-1}}|Fourth=Fo.A. {{#explode:{{PAGENAME}}| |-1}}''' or '''F.O. {{#explode:{{PAGENAME}}| |-1}}|Valian=V.Y. {{#explode:{{PAGENAME}}| |-1}}}}{{#switch:{{#explode:{{PAGENAME}}| |3}}|Trees=Y.T. {{#explode:{{PAGENAME}}| |-1}}|Lamps=Y.L. {{#explode:{{PAGENAME}}| |-1}}}}''') is the {{#explode:{{PAGENAME}}| |-1}}{{#switch:{{#sub:{{PAGENAME}}|-2}}|01|21|31|41|51|61|71|81|91=st|02|22|32|42|52|62|72|82|92=nd|03|23|33|43|53|63|73|83|93=rd|#default=th}}{{#ifeq:{{PAGENAME}}|Third Age 3021|, and last,}}{{#ifeq:{{PAGENAME}}|First Age 590|, and last,}}{{#ifeq:{{PAGENAME}}|Second Age 3441|, and last,}} {{#switch:{{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}|First Age|Second Age|Third Age|Fourth Age=[[Years of the Sun|year of the Sun]] of the [[{{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}]] of [[Middle-earth]]|the Trees=[[Years of the Trees|year of the Trees]] of [[Arda]]|the Lamps=[[Years of the Lamps|year of the Lamps]] of Arda|Valian Year=[[Valian Years|Valian year]] of [[Arda]]}}. {{#ifeq:{{#explode:{{PAGENAME}}| |3}}|Trees|{{PAGENAME}} was also known as '''V.Y. {{#expr:{{#explode:{{PAGENAME}}| |-1}}+3500}}''' in [[Valian Years]].}}{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Fourth|{{PAGENAME}} was also known as '''S.R. {{#expr:{{#explode:{{PAGENAME}}| |-1}}+1421}}''' in [[Shire-reckoning]].}}{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Third|{{#ifexpr:{{#explode:{{PAGENAME}}| |-1}}>1600|{{PAGENAME}} was also known as '''S.R. {{#expr:{{#explode:{{PAGENAME}}| |-1}}-1600}}''' in [[Shire-reckoning]].}}}} {{#ifeq:{{PAGENAME}}|Third Age 3021|In the reckoning of [[Gondor]] the [[Fourth Age]] began on [[25 March]]; unless otherwise stated, [[Tolkien Gateway]] follows Shire-reckoning in that Fourth Age 1 is equivalent to S.R. 1422.}}
'''{{PAGENAME}}''' (abbreviated to '''{{#switch:{{#explode:{{PAGENAME}}| |0}}|First=F.A. {{#explode:{{PAGENAME}}| |-1}}|Second=S.A. {{#explode:{{PAGENAME}}| |-1}}|Third=T.A. {{#explode:{{PAGENAME}}| |-1}}|Fourth=Fo.A. {{#explode:{{PAGENAME}}| |-1}}''' or '''F.O. {{#explode:{{PAGENAME}}| |-1}}|Valian=V.Y. {{#explode:{{PAGENAME}}| |-1}}}}{{#switch:{{#explode:{{PAGENAME}}| |3}}|Trees=Y.T. {{#explode:{{PAGENAME}}| |-1}}|Lamps=Y.L. {{#explode:{{PAGENAME}}| |-1}}}}''') is the {{#explode:{{PAGENAME}}| |-1}}{{#switch:{{#sub:{{PAGENAME}}|-2}}|01|21|31|41|51|61|71|81|91=st|02|22|32|42|52|62|72|82|92=nd|03|23|33|43|53|63|73|83|93=rd|#default=th}}{{#ifeq:{{PAGENAME}}|Third Age 3021|, and last,}}{{#ifeq:{{PAGENAME}}|First Age 590|, and last,}}{{#ifeq:{{PAGENAME}}|Second Age 3441|, and last,}} {{#switch:{{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}|First Age|Second Age|Third Age|Fourth Age=[[Years of the Sun|year of the Sun]] of the [[{{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}]] of [[Middle-earth]]|the Trees=[[Years of the Trees|year of the Trees]] {{#ifexpr:{{#explode:{{PAGENAME}}| |-1}}>=1050|in the [[First Age]]}} of [[Arda]]|the Lamps=[[Years of the Lamps|year of the Lamps]] of Arda|Valian Year=[[Valian Years|Valian year]] of [[Arda]]}}. {{#ifeq:{{#explode:{{PAGENAME}}| |3}}|Trees|{{PAGENAME}} was also '''V.Y. {{#expr:{{#explode:{{PAGENAME}}| |-1}}+3500}}''' in [[Valian Years]].}}{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Fourth|Unless otherwise stated, [[Tolkien Gateway]] follows [[The Shire|Shire]] usage in [[Appendix B]] for reckoning Fourth Age years: {{PAGENAME}} was also known as '''S.R. {{#expr:{{#explode:{{PAGENAME}}| |-1}}+1421}}''' in [[Shire-reckoning]].}}{{#ifeq:{{#explode:{{PAGENAME}}| |0}}|Third|{{#ifexpr:{{#explode:{{PAGENAME}}| |-1}}>1600|{{PAGENAME}} was also known as '''S.R. {{#expr:{{#explode:{{PAGENAME}}| |-1}}-1600}}''' in [[Shire-reckoning]].}}}} {{#ifeq:{{PAGENAME}}|Third Age 3021|In the reckoning of [[Gondor]] the [[Fourth Age]] began on [[25 March]]; unless otherwise stated, [[Tolkien Gateway]] follows Shire-reckoning in that Fourth Age 1 is equivalent to {{SR|1422}}.}}{{#ifeq:{{PAGENAME}}|First Age 472|This year is also known as the '''Year of Lamentation'''.}}{{#ifeq:{{PAGENAME}}|First Age 455|This year is also known as the '''Fell Year'''.}}


Notable events in this year include:  
Notable events in this year include:</includeonly><noinclude>'''Template:Ardayearheader''' is a complicated template for generating opening text and an infobox on all year articles on [[J.R.R. Tolkien]]'s works. The template will automatically create an appropriate opening descriptive sentence - with conversions to [[Valian Years]] or [[Shire-reckoning]] as appropriate - whilst creating a date-related infobox on the right-hand side.
<noinclude>[[Category:Calendars and events templates]]</noinclude>
 
'''Do not edit this template.'''
==Usage==
<pre>
{{ardayearheader|1|2|3|4|5|6|7}}
</pre>
Where:<br/>'''1''', '''2''', '''3''', '''4''', '''5''', '''6''' and '''7''' are the seven years that appear in the infobox on the right-hand side.
 
Unless at the start or end of a sequence (e.g. [[Fourth Age 220]]), '''4''' should be the current year of the article. If left blank, '''4''' will be the current year whilst - regardless of whether any of these articles exist - '''1''', '''2''', '''3''' will be the three preceding years and '''5''', '''6''', '''7''' will be the three following years.
 
If all the dates in the infobox are from the same age as the article itself you do not need to prefix the years with the age. E.g. the infobox for [[Third Age 490]] is <nowiki>{{ardayearheader|435|462|480|490|492|500|515}}</nowiki>. However, this can be over-ruled by simply putting the year article in full; e.g. [[Third Age 3020]] would be <nowiki>{{ardayearheader|3017|3018|3019|3020|3021|Fourth Age 1|Fourth Age 2}}</nowiki>
 
[[Category:Calendars and events templates]]</noinclude>

Revision as of 12:32, 30 May 2015

Template:Ardayearheader is a complicated template for generating opening text and an infobox on all year articles on J.R.R. Tolkien's works. The template will automatically create an appropriate opening descriptive sentence - with conversions to Valian Years or Shire-reckoning as appropriate - whilst creating a date-related infobox on the right-hand side.

Do not edit this template.

Usage

{{ardayearheader|1|2|3|4|5|6|7}}

Where:
1, 2, 3, 4, 5, 6 and 7 are the seven years that appear in the infobox on the right-hand side.

Unless at the start or end of a sequence (e.g. Fourth Age 220), 4 should be the current year of the article. If left blank, 4 will be the current year whilst - regardless of whether any of these articles exist - 1, 2, 3 will be the three preceding years and 5, 6, 7 will be the three following years.

If all the dates in the infobox are from the same age as the article itself you do not need to prefix the years with the age. E.g. the infobox for Third Age 490 is {{ardayearheader|435|462|480|490|492|500|515}}. However, this can be over-ruled by simply putting the year article in full; e.g. Third Age 3020 would be {{ardayearheader|3017|3018|3019|3020|3021|Fourth Age 1|Fourth Age 2}}