Difference between revisions of "Template:Births and deaths by year for decade"

From blackwiki
Jump to navigation Jump to search
imported>Pppery
(loop-ify call to transcluding articles with its repetitive dr calls)
imported>Pppery
(oops)
Line 2: Line 2:
 
|<nowiki>== {{ucfirst:{{{1}}}}} ==
 
|<nowiki>== {{ucfirst:{{{1}}}}} ==
 
{{preprocess|{{((}}transcluding articles
 
{{preprocess|{{((}}transcluding articles
   {{!}} {{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|{{dr|y|y|{{{year}}}0|0|{{#ifexpr:{{{year}}}<=10|na|n}}}}}}
+
   {{!}} {{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|{{dr|y|y|{{{year}}}0|0|n{{#ifexpr:{{{year}}}<=10|a}}}}}}
   {{!}} {{for loop|{{!}}|call=dr|pc1n=1|pc1v=y|pc2n=2|pc2v=y|pc3n=3|pc3v={{{year}}}0|pc4n=5|pc4v={{#ifexpr:{{{year}}}<10|na|n}}|pv=4|1|2|3|4|5|6|7|8|9|10}}
+
   {{!}} {{for loop|{{!}}|call=dr|pc1n=1|pc1v=y|pc2n=2|pc2v=y|pc3n=3|pc3v={{{year}}}0|pc4n=5|pc4v={{#ifexpr:{{{year}}}<10|na|n}}|pv=4|1|2|3|4|5|6|7|8|9}}
 
{{))}}}}
 
{{))}}}}
 
{{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|
 
{{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|

Revision as of 14:12, 24 June 2017

Births

Template:Preprocess

Lua error: expandTemplate: template "Transclude births" does not exist.

Deaths

Template:Preprocess

Lua error: expandTemplate: template "Transclude deaths" does not exist.


Template documentation

Usage

Invoked with a decade as single argument, for example {{Transclude deaths|82}} for the 820s, the template compiles the list of births and deaths from each year article of the decade, by transcluding their "Births" and "Deaths" sections. Empty or non-existent sections are not transcluded. Year numbers are prepended to the transcluded contents with bold pseudo-headers, in order to avoid overloading the transcluding page's table of contents.

Negative years use the BC suffix, years 1–100 use the AD prefix, and years above 100 use the plain year number.

Example: the 70s AD

Births

Template:Preprocess Template:Transclude births Lua error: expandTemplate: template "Transclude births" does not exist.

Deaths

Template:Preprocess Template:Transclude deaths Lua error: expandTemplate: template "Transclude deaths" does not exist.


References