From GamingWiki
| (7 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
-->|{{PAGENAME}}<!-- | -->|{{PAGENAME}}<!-- | ||
-->|{{{year|<!-- Conditional default value: | -->|{{{year|<!-- Conditional default value: | ||
| − | -->< | + | -->{{#rmatch:{{PAGENAME}}|^\d+$<!-- |
| − | + | -->|{{PAGENAME}}<!-- | |
| + | -->|{{Campaign year|campaign={{{campaign|}}}}}<!-- | ||
| + | -->}}<!-- | ||
-->}}}<!-- | -->}}}<!-- | ||
-->}}<!-- end ifeq | -->}}<!-- end ifeq | ||
| Line 29: | Line 31: | ||
--> by any number of values, separated from the key and from each other by <!-- | --> by any number of values, separated from the key and from each other by <!-- | ||
--> double colons. <!-- | --> double colons. <!-- | ||
| − | -->{{#vardefine: datatemplate|<!-- | + | --></noinclude><!-- |
| + | -->{{#vardefine: datatemplate|Year in topic/<!-- | ||
If we've specified a campaign, look for that campaign's subtemplate. | If we've specified a campaign, look for that campaign's subtemplate. | ||
| − | -->{{#ifexist: Template:Year in topic/{{{campaign| | + | -->{{#ifexist: Template:Year in topic/{{{campaign|MAGIC_DNE}}}<!-- |
| − | -->| | + | -->|{{{campaign}}}<!-- |
| − | -->| | + | -->|default<!-- |
-->}}<!-- end ifexist | -->}}<!-- end ifexist | ||
-->}}<!-- end vardefine | -->}}<!-- end vardefine | ||
| Line 42: | Line 45: | ||
-->{{#hashdefine: datahash | {{#var:ytdata}} | ;; | :: }}<!-- | -->{{#hashdefine: datahash | {{#var:ytdata}} | ;; | :: }}<!-- | ||
| − | + | ||
| + | If an empty key exists, any value it contains will be evaluated as wikitext. | ||
| + | This allows us to insert things like category specifications that don't | ||
| + | become part of the data variable. Once evaluated, the empty key is | ||
| + | removed from the hash. | ||
| + | -->{{#hashvalue: datahash | }}<!-- | ||
-->{{#hashexclude: datahash | }}<!-- | -->{{#hashexclude: datahash | }}<!-- | ||
| + | |||
--> | --> | ||
| − | {| class="infobox" | + | {| class="infobox floatright" |
| − | {{#hashprint: datahash | | + | | align="center" class="above" | <!-- |
| − | + | --><div class="floatleft">« [[{{#expr:{{#var:theyear}}-1}}]]</div><!-- | |
| − | {{!}}- | + | -->{{#var:theyear}} by topic<!-- |
| − | {{!}} | + | --><div class="floatright">[[{{#expr:{{#var:theyear}}+1}}]] »</div><!-- |
| + | -->{{#hashprint: datahash ||%%%% |@@@@ |<nowiki /> | ||
| + | {{!}}- | ||
| + | {{!}} class="subhead" {{!}} %%%% | ||
{{!}}- | {{!}}- | ||
| − | {{!}} | + | {{!}}{{!}} {{Array Map | array=@@@@ | separator = :: | beforefirst = | before = – }}<!-- |
-->}}<!-- --><nowiki /> | -->}}<!-- --><nowiki /> | ||
|- | |- | ||
| − | | <!-- | + | | class="below" | <!-- |
--> {{navbar|Year in topic|mini=1|nodiv=1|brackets=1|label=Box:}} <!-- | --> {{navbar|Year in topic|mini=1|nodiv=1|brackets=1|label=Box:}} <!-- | ||
--> {{navbar|{{#var:datatemplate}}|mini=1|nodiv=1|brackets=1|label=Data:}} | --> {{navbar|{{#var:datatemplate}}|mini=1|nodiv=1|brackets=1|label=Data:}} | ||
| Line 60: | Line 72: | ||
TODO: implement "other calendars" | TODO: implement "other calendars" | ||
| − | --><!-- {{Year in other calendars| | + | |
| + | --><noinclude> | ||
| + | :<!-- | ||
| + | --> We also support multiple calendars, if they exist. The mechanism for <!-- | ||
| + | --> choosing a template to transclude is similar to the data template: if <!-- | ||
| + | --> the 'campaign' parameter has been specified, and if the page <!-- | ||
| + | --> <tt>Template:Year in other calendars/{{{campaign}}}</tt> exists, then <!-- | ||
| + | --> we transclude it. If {{{campaign}}} is unset or, or the template does <!-- | ||
| + | --> not exist, we use <tt>Template:Year in other calendars/default</tt>. <!-- | ||
| + | --></noinclude><!-- | ||
| + | -->{{#vardefine: calendars| Year in other calendars/<!-- | ||
| + | If we've specified a campaign, look for that campaign's subtemplate. | ||
| + | -->{{#ifexist: Template:Year in other calendars/{{{campaign|MAGIC_DNE}}}<!-- | ||
| + | -->|{{{campaign}}}<!-- | ||
| + | -->|default<!-- | ||
| + | -->}}<!-- end ifexist | ||
| + | -->}}<!-- end vardefine | ||
| + | --><!-- {{ {{#var:calendars}}|year={{#var:theyear}}}} --><!-- | ||
| + | -->{{Year in other calendars | ||
| + | | year = {{#var:theyear}} | ||
| + | | campaign = {{{campaign|}}} }}<!-- | ||
--><noinclude> | --><noinclude> | ||
[[Category:Time, date and calendar templates|{{#var:theyear}}]]</noinclude> | [[Category:Time, date and calendar templates|{{#var:theyear}}]]</noinclude> | ||
Latest revision as of 16:26, 22 February 2011
Display an infobox linking to the various topics related to this year.
- We create a variable containing the name of the subtemplate containing data for our infobox. This data will be parsed into a HashTable. The keys of the hash are the sections of the "year in" topics, and each value is a link to the relevant page. The format of the data is:
;; key1 :: value1-1 :: value1-2 ;; key2 :: value2-1 ;; key3 :: value3-1 :: value3-2 :: value3-3
- Et cetera. Each key starts with a double semicolon and may be followed by any number of values, separated from the key and from each other by double colons.
« 2024 2025 by topic2026 »
|
| Subject |
| Archaeology – Architecture – Art – Aviation – Awards – Comics – Film – Home video – Literature (Poetry) – Meteorology – Music (Country, Metal) – Rail transport – Radio – Science – Sports – Television – Video gaming |
| By country |
| Australia – Canada – People's Republic of China – Ecuador – France – Germany – Greece – India – Ireland – Israel – Italy – Japan – Luxembourg – Malaysia – Mexico – New Zealand – Norway – Pakistan – Philippines – Russia – Singapore – South Africa – UK – USA – Zimbabwe |
| Leaders |
| Sovereign states – State leaders – Religious leaders – Law |
| Birth and death |
| Births – Deaths |
| Establishments and disestablishments |
| Establishments – Disestablishments |
| Works and introductions |
| Works – Introductions |
- We also support multiple calendars, if they exist. The mechanism for choosing a template to transclude is similar to the data template: if the 'campaign' parameter has been specified, and if the page Template:Year in other calendars/{{{campaign}}} exists, then we transclude it. If {{{campaign}}} is unset or, or the template does not exist, we use Template:Year in other calendars/default.
| Gregorian calendar | 2025 MMXXV |
| Ab urbe condita | 2778 |
| Bahá'í calendar | 181 – 182 |
| Bengali calendar | 1432 |
| Berber calendar | 2975 |
| Buddhist calendar | 2569 |
| Burmese calendar | 1387 |
| Byzantine calendar | 7533 – 7534 |
| Coptic calendar | 1741 – 1742 |
| Ethiopian calendar | 2017 – 2018 |
| Hebrew calendar | 5785 – 5786 |
| Holocene calendar | 12025 |
| Iranian calendar | 1403 – 1404 |
| Islamic calendar | 1446 – 1447 |
| Korean calendar | 4358 |
| Thai solar calendar | 2568 |
| Unix time | 1735689600 – 1767225599 |