From GamingWiki
Line 2: | Line 2: | ||
Display an infobox linking to the various topics related to this year. | Display an infobox linking to the various topics related to this year. | ||
</noinclude><!-- | </noinclude><!-- | ||
+ | |||
+ | VARIABLES | ||
Create a variable to hold the year number. | Create a variable to hold the year number. | ||
-->{{#vardefine: theyear|<!-- | -->{{#vardefine: theyear|<!-- | ||
− | -->{{#ifeq:{{{1}}}|BC|{{PAGENAME}}|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}}}<!-- | + | -->{{#ifeq:{{{1}}}|BC<!-- |
+ | -->|{{PAGENAME}}<!-- | ||
+ | -->|{{{year|<!-- Conditional default value: | ||
+ | --><noinclude>{{CURRENTYEAR}}</noinclude><!-- | ||
+ | --><includeonly>{{PAGENAME}}</includeonly><!-- | ||
+ | -->}}}<!-- | ||
+ | -->}}<!-- end ifeq | ||
-->}}<!-- | -->}}<!-- | ||
− | + | --><noinclude> | |
− | + | :<!-- | |
− | -->{{#vardefine: | + | --> 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. <!-- | ||
+ | -->{{#vardefine: datatemplate|<!-- | ||
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|MAGIC_NO_SUCH}}}<!-- | -->{{#ifexist: Template:Year in topic/{{{campaign|MAGIC_NO_SUCH}}}<!-- | ||
− | + | -->|Year in topic/{{{campaign}}}<!-- | |
− | + | -->|Year in topic/default<!-- | |
-->}}<!-- end ifexist | -->}}<!-- end ifexist | ||
− | -->}}<!-- end data | + | -->}}<!-- end vardefine |
+ | |||
+ | Define a big data array. | ||
+ | |||
+ | -->{{#vardefine: ytdata|{{ {{#var: datatemplate}}|year={{#var:theyear}}}}}}<!-- | ||
-->{{#hashdefine: datahash | {{#var:ytdata}} | ;; | :: }}<!-- | -->{{#hashdefine: datahash | {{#var:ytdata}} | ;; | :: }}<!-- | ||
Line 31: | Line 54: | ||
-->}}<!-- --><nowiki /> | -->}}<!-- --><nowiki /> | ||
|- | |- | ||
− | | {{navbar|Year in topic|mini=1}} | + | | <!-- |
+ | --> {{navbar|Year in topic|mini=1|nodiv=1|brackets=1|label=Box:}} <!-- | ||
+ | --> {{navbar|{{#var:datatemplate}}|mini=1|nodiv=1|brackets=1|label=Data:}} | ||
|}<!-- | |}<!-- | ||
Revision as of 16:28, 20 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.
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 |